Sha256: f4f4b588b60371acebb0f87b7aff90c79fdc30a0eee7254dd6548b867753d8cd

Contents?: true

Size: 354 Bytes

Versions: 4

Compression:

Stored size: 354 Bytes

Contents

class Datapipes
  # Tube takes effect data which passes through pipe.
  #
  # Build your own tube logic in `run` method.
  class Tube
    def >>(op2)
      op1 = self
      Tube.new.tap do |o|
        o.define_singleton_method(:run) do |data|
          op2.run(op1.run(data))
        end
      end
    end

    def run(data)
      data
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datapipes-0.1.3 lib/datapipes/tube.rb
datapipes-0.1.2 lib/datapipes/tube.rb
datapipes-0.1.1 lib/datapipes/tube.rb
datapipes-0.1.0 lib/datapipes/tube.rb