Class: Postscript::Model::Operators::Arithmetic::Sqrt
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Arithmetic::Sqrt
- 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:) ⇒ Sqrt
constructor
A new instance of Sqrt.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:) ⇒ Sqrt
Returns a new instance of Sqrt.
175 176 177 178 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 175 def initialize(operand:) @operand = operand freeze end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
174 175 176 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 174 def operand @operand end |
Class Method Details
.from_operands(stack) ⇒ Object
179 180 181 |
# File 'lib/postscript/model/operators/arithmetic.rb', line 179 def self.from_operands(stack) new(operand: stack.pop_number) end |