Class: Enumerable::Mapper

Inherits:
Object show all
Defined in:
lib/enum.rb

Overview

:nodoc:

Instance Method Summary collapse

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