Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Array.take

DZone's Guide to

Array.take

· ·
Free Resource

class Array
  # [:a,:b].take(:to_s) #=> ['a','b']
  def take(property)
    collect {|obj| obj.send(property)}
  end
end
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}