Sha256: 3a3cffe9887ce38ba5d5c839af8cc95c5c57a648418795f0c6e320a306dce2ba

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

class Datapipes
  # Tube takes effect data which passes through pipe.
  #
  # Build your own tube logic in `run` method.
  class Tube
    include Composable

    def run_all(data)
      @accumulated ||= [self]

      @accumulated.reduce(data) do |d, tube|
        if tube.accept? d
          tube.run(d)
        else
          d
        end
      end
    end

    def accept?(data)
      true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datapipes-0.0.4 lib/datapipes/tube.rb