Class: Postscript::Model::Operators::Path::Rmoveto

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/path.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(dx:, dy:) ⇒ Rmoveto

Returns a new instance of Rmoveto.



29
30
31
32
33
# File 'lib/postscript/model/operators/path.rb', line 29

def initialize(dx:, dy:)
  @dx = dx
  @dy = dy
  freeze
end

Instance Attribute Details

#dxObject (readonly)

Returns the value of attribute dx.



28
29
30
# File 'lib/postscript/model/operators/path.rb', line 28

def dx
  @dx
end

#dyObject (readonly)

Returns the value of attribute dy.



28
29
30
# File 'lib/postscript/model/operators/path.rb', line 28

def dy
  @dy
end

Class Method Details

.from_operands(stack) ⇒ Object



34
35
36
37
38
# File 'lib/postscript/model/operators/path.rb', line 34

def self.from_operands(stack)
  dy = stack.pop_number
  dx = stack.pop_number
  new(dx: dx, dy: dy)
end