Module: PipedRuby

Defined in:
lib/piped_ruby.rb,
lib/piped_ruby/version.rb

Constant Summary collapse

VERSION =
'0.2.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pipedObject

Returns the value of attribute piped.



4
5
6
# File 'lib/piped_ruby.rb', line 4

def piped
  @piped
end

Instance Method Details

#>>(&chained) ⇒ Object



6
7
8
9
10
# File 'lib/piped_ruby.rb', line 6

def >>(&chained)
  self.piped = call if piped.nil?
  chained.piped = chained.call(piped)
  chained
end

#unwrapObject



12
13
14
# File 'lib/piped_ruby.rb', line 12

def unwrap
  piped || call
end