Module: Multiton::Utils

Defined in:
lib/multiton/utils.rb

Overview

Adds compatibility methods to support different Ruby versions.

Instance Method Summary collapse

Instance Method Details

#hash_key(hash, value) ⇒ Object

call-seq:

hash_key(hash, value) => key

Returns the key associated with value on hash. If value does not exist returns nil.



12
13
14
# File 'lib/multiton/utils.rb', line 12

def hash_key(hash, value)
  hash.key value
end