Class: Postsvg::Model::Operators::Boolean::Xor
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Boolean::Xor
- Defined in:
- lib/postsvg/model/operators/boolean.rb
Instance Attribute Summary collapse
-
#operand_a ⇒ Object
readonly
Returns the value of attribute operand_a.
-
#operand_b ⇒ Object
readonly
Returns the value of attribute operand_b.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operand_a:, operand_b:) ⇒ Xor
constructor
A new instance of Xor.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand_a:, operand_b:) ⇒ Xor
Returns a new instance of Xor.
146 147 148 149 150 |
# File 'lib/postsvg/model/operators/boolean.rb', line 146 def initialize(operand_a:, operand_b:) @operand_a = operand_a @operand_b = operand_b freeze end |
Instance Attribute Details
#operand_a ⇒ Object (readonly)
Returns the value of attribute operand_a.
145 146 147 |
# File 'lib/postsvg/model/operators/boolean.rb', line 145 def operand_a @operand_a end |
#operand_b ⇒ Object (readonly)
Returns the value of attribute operand_b.
145 146 147 |
# File 'lib/postsvg/model/operators/boolean.rb', line 145 def operand_b @operand_b end |
Class Method Details
.from_operands(stack) ⇒ Object
140 141 142 143 144 |
# File 'lib/postsvg/model/operators/boolean.rb', line 140 def self.from_operands(stack) b = stack.pop a = stack.pop new(operand_a: a, operand_b: b) end |