= enumerable_mapper
This gem provides a shorthand for simple .map/.collect calls on collections.
Example:
Person.find(:all).collect{ |p| p.email }
Could be written as:
Person.find(:all).collected.email
Of course, this works with arguments too:
["wow", "this", "is", "easy"].mapped.gsub('s','sh') # => ["wow", "thish", "ish", "eashy"]
my_array.collected returns a Mapper object, which means you can do:
collect = Person.find(:all).collected
emails = collect.email
names = collect.name
= License
enumerable_mapper is licensed under the MIT license.
Copyright (c) 2007 Inge J?rgensen <[email protected]>
This gem provides a shorthand for simple .map/.collect calls on collections.
Example:
Person.find(:all).collect{ |p| p.email }
Could be written as:
Person.find(:all).collected.email
Of course, this works with arguments too:
["wow", "this", "is", "easy"].mapped.gsub('s','sh') # => ["wow", "thish", "ish", "eashy"]
my_array.collected returns a Mapper object, which means you can do:
collect = Person.find(:all).collected
emails = collect.email
names = collect.name
= License
enumerable_mapper is licensed under the MIT license.
Copyright (c) 2007 Inge J?rgensen <[email protected]>