Class: Postsvg::Model::Operators::Path::Rlineto

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

Returns a new instance of Rlineto.



59
60
61
62
63
# File 'lib/postsvg/model/operators/path.rb', line 59

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

Instance Attribute Details

#dxObject (readonly)

Returns the value of attribute dx.



58
59
60
# File 'lib/postsvg/model/operators/path.rb', line 58

def dx
  @dx
end

#dyObject (readonly)

Returns the value of attribute dy.



58
59
60
# File 'lib/postsvg/model/operators/path.rb', line 58

def dy
  @dy
end

Class Method Details

.from_operands(stack) ⇒ Object



64
65
66
67
68
# File 'lib/postsvg/model/operators/path.rb', line 64

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