class Transproc::Composite
Composition of two functions
@api private
Attributes
left[R]
@return [Proc]
@api private
right[R]
@return [Proc]
@api private
Public Class Methods
new(left, right)
click to toggle source
@api private
# File lib/transproc/composite.rb, line 19 def initialize(left, right) @left = left @right = right end
Public Instance Methods
call(value)
click to toggle source
Call right side with the result from the left side
@param [Object] value The input value
@return [Object]
@api public
# File lib/transproc/composite.rb, line 31 def call(value) right.call(left.call(value)) end
Also aliased as: []
compose(other)
click to toggle source
@see Function#compose
@api public
# File lib/transproc/composite.rb, line 39 def compose(other) self.class.new(self, other) end
to_ast()
click to toggle source
@see Function#to_ast
@api public
# File lib/transproc/composite.rb, line 48 def to_ast left.to_ast << right.to_ast end