Class: Warg::ChainCommand
- Inherits:
-
Object
- Object
- Warg::ChainCommand
- Defined in:
- lib/warg.rb
Instance Method Summary collapse
- #call(context) ⇒ Object
-
#initialize(left, right) ⇒ ChainCommand
constructor
A new instance of ChainCommand.
- #|(other) ⇒ Object
Constructor Details
#initialize(left, right) ⇒ ChainCommand
Returns a new instance of ChainCommand.
2116 2117 2118 2119 |
# File 'lib/warg.rb', line 2116 def initialize(left, right) @left = left @right = right end |
Instance Method Details
#call(context) ⇒ Object
2121 2122 2123 |
# File 'lib/warg.rb', line 2121 def call(context) @left.(context) | @right end |
#|(other) ⇒ Object
2125 2126 2127 |
# File 'lib/warg.rb', line 2125 def |(other) ChainCommand.new(self, other) end |