Class: CooCoo::Transformers::Combo
- Inherits:
-
Base
- Object
- Enumerator
- Base
- CooCoo::Transformers::Combo
- Defined in:
- lib/coo-coo/transformer.rb
Instance Method Summary collapse
-
#initialize(src, other, &op) ⇒ Combo
constructor
A new instance of Combo.
- #next ⇒ Object
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
#next ⇒ Object
84 85 86 |
# File 'lib/coo-coo/transformer.rb', line 84 def next @op.call(@src.next, @other.next) end |