Class: Enumerable::Mapper
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(collection) ⇒ Mapper
constructor
A new instance of Mapper.
- #method_missing(meth_id, *args) ⇒ Object
Constructor Details
#initialize(collection) ⇒ Mapper
Returns a new instance of Mapper.
63 64 65 |
# File 'lib/enum.rb', line 63 def initialize( collection ) @collection = collection end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth_id, *args) ⇒ Object
66 67 68 |
# File 'lib/enum.rb', line 66 def method_missing( meth_id, *args) @collection.map{ |a| a.send(meth_id, *args) } end |