Class: Postsvg::Model::Operators::Path::Rcurveto

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(dx1:, dy1:, dx2:, dy2:, dx3:, dy3:) ⇒ Rcurveto

Returns a new instance of Rcurveto.



97
98
99
100
101
102
103
104
105
# File 'lib/postsvg/model/operators/path.rb', line 97

def initialize(dx1:, dy1:, dx2:, dy2:, dx3:, dy3:)
  @dx1 = dx1
  @dy1 = dy1
  @dx2 = dx2
  @dy2 = dy2
  @dx3 = dx3
  @dy3 = dy3
  freeze
end

Instance Attribute Details

#dx1Object (readonly)

Returns the value of attribute dx1.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dx1
  @dx1
end

#dx2Object (readonly)

Returns the value of attribute dx2.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dx2
  @dx2
end

#dx3Object (readonly)

Returns the value of attribute dx3.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dx3
  @dx3
end

#dy1Object (readonly)

Returns the value of attribute dy1.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dy1
  @dy1
end

#dy2Object (readonly)

Returns the value of attribute dy2.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dy2
  @dy2
end

#dy3Object (readonly)

Returns the value of attribute dy3.



96
97
98
# File 'lib/postsvg/model/operators/path.rb', line 96

def dy3
  @dy3
end

Class Method Details

.from_operands(stack) ⇒ Object



106
107
108
109
110
111
112
113
114
# File 'lib/postsvg/model/operators/path.rb', line 106

def self.from_operands(stack)
  dy3 = stack.pop_number
  dx3 = stack.pop_number
  dy2 = stack.pop_number
  dx2 = stack.pop_number
  dy1 = stack.pop_number
  dx1 = stack.pop_number
  new(dx1: dx1, dy1: dy1, dx2: dx2, dy2: dy2, dx3: dx3, dy3: dy3)
end