Class: Postscript::Model::Operators::Arithmetic::Abs
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Arithmetic::Abs
- Defined in:
- lib/postscript/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:) ⇒ Abs
constructor
A new instance of Abs.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:) ⇒ Abs
Returns a new instance of Abs.
115 116 117 118 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 115 def initialize(operand:) @operand = operand freeze end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
114 115 116 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 114 def operand @operand end |
Class Method Details
.from_operands(stack) ⇒ Object
119 120 121 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 119 def self.from_operands(stack) new(operand: stack.pop_number) end |