Module: Enumerable

Defined in:
lib/enumerable/pluck.rb

Overview

Add pluck to enumerable… its already done for us in rails 5+

Instance Method Summary collapse

Instance Method Details

#pluck(key) ⇒ Object



3
4
5
# File 'lib/enumerable/pluck.rb', line 3

def pluck(key)
  map { |element| element[key] }
end