Class: Representable::Pipeline
- Inherits:
-
Array
- Object
- Array
- Representable::Pipeline
- Extended by:
- Macros
- Defined in:
- lib/representable/insert.rb,
lib/representable/pipeline.rb
Overview
Allows to implement a pipeline of filters where a value gets passed in and the result gets passed to the next callable object.
Direct Known Subclasses
Defined Under Namespace
Modules: Debug, Function, Macros
Constant Summary collapse
- Insert =
Pipeline::Function::Insert.new
- Stop =
Class.new
Instance Method Summary collapse
-
#call(input, options) ⇒ Object
options is mutuable.
Methods included from Macros
Instance Method Details
#call(input, options) ⇒ Object
options is mutuable.
8 9 10 11 12 13 14 |
# File 'lib/representable/pipeline.rb', line 8 def call(input, ) inject(input) do |memo, block| res = evaluate(block, memo, ) return(Stop)if Stop == res res end end |