Flowdock
method

pluck

Importance_1
v5.2.3 - Show latest stable - 0 notes - Class: Enumerable
pluck(*keys) public

Convert an enumerable to an array based on the given key.

[{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pluck(:name)
# => ["David", "Rafael", "Aaron"]

[{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name)
# => [[1, "David"], [2, "Rafael"]]
Show source
Register or log in to add new notes.