Class: Representable::Pipeline

Inherits:
Array
  • Object
show all
Includes:
Uber::Callable
Defined in:
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.

Note: this is still experimental.

Instance Method Summary collapse

Instance Method Details

#call(context, value, *args) ⇒ Object

include Representable::Cloneable


10
11
12
# File 'lib/representable/pipeline.rb', line 10

def call(context, value, *args)
  inject(value) { |memo, block| block.call(memo, *args) }
end