So I have this code:
def self.age_to_bucket(age) age = age.to_i if age >= 0 && age <= 12 1 elsif age >= 13 && age <= 17
irb(main):010:0> a = {1 => 0..12, 2 => 13..17} # insert other values here => {1=>0..12, 2=>13..17} irb(main):011:0> age = 16 => 16 irb(main):012:0> a.keys.find {|k| a[k].include?(age) } => 2