Class: Postsvg::Model::Operators::Arithmetic::Truncate
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Arithmetic::Truncate
- Defined in:
- lib/postsvg/model/operators/arithmetic.rb
Instance Attribute Summary collapse
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operand:) ⇒ Truncate
constructor
A new instance of Truncate.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:) ⇒ Truncate
Returns a new instance of Truncate.
163 164 165 166 |
# File 'lib/postsvg/model/operators/arithmetic.rb', line 163 def initialize(operand:) @operand = operand freeze end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
162 163 164 |
# File 'lib/postsvg/model/operators/arithmetic.rb', line 162 def operand @operand end |
Class Method Details
.from_operands(stack) ⇒ Object
167 168 169 |
# File 'lib/postsvg/model/operators/arithmetic.rb', line 167 def self.from_operands(stack) new(operand: stack.pop_number) end |