mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
removes Enumerable#pluck from the AS guide
This commit is contained in:
@@ -2053,16 +2053,6 @@ end
|
||||
|
||||
NOTE: Defined in +active_support/core_ext/enumerable.rb+.
|
||||
|
||||
h4. +pluck+
|
||||
|
||||
The +pluck+ method collects the value of the passed method for each element and returns the result as an array.
|
||||
|
||||
<ruby>
|
||||
people.pluck(:name) # => [ "David Heinemeier Hansson", "Jamie Heinemeier Hansson" ]
|
||||
</ruby>
|
||||
|
||||
NOTE: Defined in +active_support/core_ext/enumerable.rb+.
|
||||
|
||||
h4. +each_with_object+
|
||||
|
||||
The +inject+ method offers iteration with an accumulator:
|
||||
|
||||
Reference in New Issue
Block a user