Class: Postscript::Model::Operators::Transformations::Rotate

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/transformations.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postscript::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(angle:) ⇒ Rotate

Returns a new instance of Rotate.



40
41
42
43
# File 'lib/postscript/model/operators/transformations.rb', line 40

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

Instance Attribute Details

#angleObject (readonly)

Returns the value of attribute angle.



39
40
41
# File 'lib/postscript/model/operators/transformations.rb', line 39

def angle
  @angle
end

Class Method Details

.from_operands(stack) ⇒ Object



44
45
46
# File 'lib/postscript/model/operators/transformations.rb', line 44

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