Class: Enumerable::Chain

Inherits:
BasicObject
Defined in:
lib/enumerable-chain.rb

Instance Method Summary collapse

Constructor Details

#initialize(*a, &b) ⇒ Chain

Returns a new instance of Chain.



4
# File 'lib/enumerable-chain.rb', line 4

def initialize(*a, &b) @s, @m, *@a, @b = *a, b end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*a, &b) ⇒ Object



5
# File 'lib/enumerable-chain.rb', line 5

def method_missing(*a, &b) Chain.new self, *a, &b end

Instance Method Details

#>Object



6
# File 'lib/enumerable-chain.rb', line 6

def >; @m ? @s.>.map{|i| i.send @m, *@a, &@b} : @s end