Class: Postsvg::Model::Operators::Arithmetic::Atan

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_a:, operand_b:) ⇒ Atan

Returns a new instance of Atan.



192
193
194
195
196
# File 'lib/postsvg/model/operators/arithmetic.rb', line 192

def initialize(operand_a:, operand_b:)
  @operand_a = operand_a
  @operand_b = operand_b
  freeze
end

Instance Attribute Details

#operand_aObject (readonly)

Returns the value of attribute operand_a.



191
192
193
# File 'lib/postsvg/model/operators/arithmetic.rb', line 191

def operand_a
  @operand_a
end

#operand_bObject (readonly)

Returns the value of attribute operand_b.



191
192
193
# File 'lib/postsvg/model/operators/arithmetic.rb', line 191

def operand_b
  @operand_b
end

Class Method Details

.from_operands(stack) ⇒ Object



186
187
188
189
190
# File 'lib/postsvg/model/operators/arithmetic.rb', line 186

def self.from_operands(stack)
  b = stack.pop_number
  a = stack.pop_number
  new(operand_a: a, operand_b: b)
end