Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/week_of_month.rb

Instance Method Summary collapse

Instance Method Details

#key(value) ⇒ Object



82
83
84
85
86
# File 'lib/week_of_month.rb', line 82

def key(value)
  result = nil
  each { |k, v| result = k if v == value && result.nil?; } if values.include?(value)
  result
end