Method: Immutable::Hash#rassoc
- Defined in:
- lib/immutable/hash.rb
#rassoc(obj) ⇒ Array
Searches through the Hash, comparing obj with each value (using ‘#==`). When a matching value is found, return the `[key, value]` pair as an array. Return nil if no match is found.
675 676 677 678 |
# File 'lib/immutable/hash.rb', line 675 def rassoc(obj) each { |entry| return entry if obj == entry[1] } nil end |