Class: Enumerable::Proxy
Instance Method Summary collapse
-
#initialize(enum, method = :map) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(enum, method = :map) ⇒ Proxy
Returns a new instance of Proxy.
459 460 461 |
# File 'lib/mylibs.rb', line 459 def initialize(enum, method=:map) @enum, @method = enum, method end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
462 463 464 |
# File 'lib/mylibs.rb', line 462 def method_missing(method, *args, &block) @enum.__send__(@method) {|o| o.__send__(method, *args, &block) } end |