Class: CooCoo::Transformers::Combo

Inherits:
Base show all
Defined in:
lib/coo-coo/transformer.rb

Instance Method Summary collapse

Methods inherited from Base

bin_op, bin_op_inner, #drop, #first

Constructor Details

#initialize(src, other, &op) ⇒ Combo

Returns a new instance of Combo.



72
73
74
75
76
77
78
79
80
81
82
# File 'lib/coo-coo/transformer.rb', line 72

def initialize(src, other, &op)
  @src = src
  @other = other
  @op = op
  
  super() do |yielder|
    loop do
      yielder << self.next
    end
  end
end

Instance Method Details

#nextObject



84
85
86
# File 'lib/coo-coo/transformer.rb', line 84

def next
  @op.call(@src.next, @other.next)
end