Class: Postsvg::Model::Operators::Arithmetic::Round

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/arithmetic.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postsvg::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(operand:) ⇒ Round

Returns a new instance of Round.



151
152
153
154
# File 'lib/postsvg/model/operators/arithmetic.rb', line 151

def initialize(operand:)
  @operand = operand
  freeze
end

Instance Attribute Details

#operandObject (readonly)

Returns the value of attribute operand.



150
151
152
# File 'lib/postsvg/model/operators/arithmetic.rb', line 150

def operand
  @operand
end

Class Method Details

.from_operands(stack) ⇒ Object



155
156
157
# File 'lib/postsvg/model/operators/arithmetic.rb', line 155

def self.from_operands(stack)
  new(operand: stack.pop_number)
end