Class: BoPeep::ChainCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ ChainCommand

Returns a new instance of ChainCommand.



2187
2188
2189
2190
# File 'lib/bopeep.rb', line 2187

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

Instance Method Details

#call(context) ⇒ Object



2192
2193
2194
# File 'lib/bopeep.rb', line 2192

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

#|(other) ⇒ Object



2196
2197
2198
# File 'lib/bopeep.rb', line 2196

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