Class: Datapipes::Tube

Inherits:
Object
  • Object
show all
Defined in:
lib/datapipes/tube.rb

Overview

Tube takes effect data which passes through pipe.

Build your own tube logic in ‘run` method.

Direct Known Subclasses

Basics::Triple

Instance Method Summary collapse

Instance Method Details

#>>(op2) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/datapipes/tube.rb', line 6

def >>(op2)
  op1 = self
  Tube.new.tap do |o|
    o.define_singleton_method(:run) do |data|
      op2.run(op1.run(data))
    end
  end
end

#run(data) ⇒ Object



15
16
17
# File 'lib/datapipes/tube.rb', line 15

def run(data)
  data
end