Sha256: 26584249a3a0143902800190c4b98adfed515ff2e654193940db00917e62ea61

Contents?: true

Size: 406 Bytes

Versions: 20

Compression:

Stored size: 406 Bytes

Contents

module Representable
  # 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.
  class Pipeline < Array
    include Uber::Callable
    # include Representable::Cloneable

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
representable-2.3.0 lib/representable/pipeline.rb
representable-2.2.3 lib/representable/pipeline.rb
representable-2.2.2 lib/representable/pipeline.rb
representable-2.2.1 lib/representable/pipeline.rb
representable-2.2.0 lib/representable/pipeline.rb
representable-2.1.8 lib/representable/pipeline.rb
representable-2.1.7 lib/representable/pipeline.rb
representable-2.1.6 lib/representable/pipeline.rb
representable-2.1.5 lib/representable/pipeline.rb
representable-2.1.4 lib/representable/pipeline.rb
representable-2.1.3 lib/representable/pipeline.rb
representable-2.1.1 lib/representable/pipeline.rb
representable-2.1.0 lib/representable/pipeline.rb
representable-2.0.4 lib/representable/pipeline.rb
representable-2.0.3 lib/representable/pipeline.rb
representable-2.0.2 lib/representable/pipeline.rb
representable-2.0.1 lib/representable/pipeline.rb
representable-2.0.0 lib/representable/pipeline.rb
representable-2.0.0.rc2 lib/representable/pipeline.rb
representable-2.0.0.rc1 lib/representable/pipeline.rb