Sha256: cb27fc1d5875c8721ca45967f1019e7df105daeaf0605b36fc0e99548bc229d1

Contents?: true

Size: 312 Bytes

Versions: 3

Compression:

Stored size: 312 Bytes

Contents

# Next is tube. Tube processes piped data. A example tube recieve
# Integer value then increase amount of the value.
#
class Triple < Datapipes::Tube
  def run(data)
    if accept? data
      [data, data, data]
    else
      data
    end
  end

  def accept?(data)
    data.is_a? Integer and data > 3
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datapipes-0.1.5 examples/lib/triple.rb
datapipes-0.1.4 examples/lib/triple.rb
datapipes-0.1.3 examples/lib/triple.rb