Class: ReeArray::IndexBy

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_array/package/ree_array/functions/index_by.rb

Instance Method Summary collapse

Instance Method Details

#call(list, &proc) ⇒ Object



9
10
11
12
13
# File 'lib/ree_lib/packages/ree_array/package/ree_array/functions/index_by.rb', line 9

def call(list, &proc)
  result = {}
  list.each { result[yield(_1)] = _1 }
  result
end