Class: Enumerable::Proxy
- Inherits:
-
Object
- Object
- Enumerable::Proxy
- Defined in:
- lib/enumerable_proxy.rb
Instance Method Summary collapse
-
#initialize(method, enumerable) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize(method, enumerable) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 |
# File 'lib/enumerable_proxy.rb', line 7 def initialize(method, enumerable) @method, @enumerable = method, enumerable end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
11 12 13 |
# File 'lib/enumerable_proxy.rb', line 11 def method_missing(method, *args) @enumerable.send(@method) {|a| a.send method, *args} end |