Class: Enumerator
- Defined in:
- lib/ruby_smart/support/core_ext/ruby/enumerator.rb
Instance Method Summary collapse
-
#from_hash(key) ⇒ Array
returns a new array with only values from provided key.
Instance Method Details
#from_hash(key) ⇒ Array
returns a new array with only values from provided key. The Enumerator must be an array of hashes.
15 16 17 |
# File 'lib/ruby_smart/support/core_ext/ruby/enumerator.rb', line 15 def from_hash(key) map &->(item){item[key]} end |