Class: Transducers::ComposedTransducer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/transducers.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(*transducers) ⇒ ComposedTransducer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ComposedTransducer.



596
597
598
# File 'lib/transducers.rb', line 596

def initialize(*transducers)
  @transducers = transducers
end

Instance Method Details

#apply(reducer) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



600
601
602
# File 'lib/transducers.rb', line 600

def apply(reducer)
  @transducers.reverse.reduce(reducer) {|r,t| t.apply(r)}
end