Method: Immutable::Hash#fetch_values
- Defined in:
- lib/immutable/hash.rb
#fetch_values(*wanted) ⇒ Vector
Return a Vector of the values which correspond to the wanted keys. If any of the wanted keys are not present in this Hash, raise KeyError exception.
604 605 606 607 |
# File 'lib/immutable/hash.rb', line 604 def fetch_values(*wanted) array = wanted.map { |key| fetch(key) } Vector.new(array.freeze) end |