Class: Warg::ChainCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ ChainCommand

Returns a new instance of ChainCommand.


2030
2031
2032
2033
# File 'lib/warg.rb', line 2030

def initialize(left, right)
  @left = left
  @right = right
end

Instance Method Details

#call(context) ⇒ Object


2035
2036
2037
# File 'lib/warg.rb', line 2035

def call(context)
  @left.(context) | @right
end

#|(other) ⇒ Object


2039
2040
2041
# File 'lib/warg.rb', line 2039

def |(other)
  ChainCommand.new(self, other)
end