class Dry::Transformer::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/dry/transformer/composite.rb, line 20
def initialize(left, right)
  @left = left
  @right = right
end

Public Instance Methods

+(other)
Alias for: compose
>>(other)
Alias for: compose
[](value)
Alias for: call
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/dry/transformer/composite.rb, line 32
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/dry/transformer/composite.rb, line 40
def compose(other)
  self.class.new(self, other)
end
Also aliased as: +, >>
to_ast() click to toggle source

@see Function#to_ast

@api public

# File lib/dry/transformer/composite.rb, line 49
def to_ast
  left.to_ast << right.to_ast
end