Class: Ramekin::Chain
Instance Attribute Summary
Attributes inherited from Processor
Instance Method Summary collapse
- #call(stream, &b) ⇒ Object
-
#initialize(processors) ⇒ Chain
constructor
A new instance of Chain.
Methods inherited from Processor
#buffer, call, compose, #each, #flush!, #next!, #peek
Constructor Details
#initialize(processors) ⇒ Chain
55 56 57 |
# File 'lib/ramekin/processor.rb', line 55 def initialize(processors) @processors = processors end |
Instance Method Details
#call(stream, &b) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/ramekin/processor.rb', line 59 def call(stream, &b) out = stream @processors.each do |p| out = p.call(out) end out end |