Class: Postscript::Model::Operators::Path::Curveto
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Path::Curveto
- Defined in:
- lib/postscript/model/operators/path.rb
Instance Attribute Summary collapse
-
#x1 ⇒ Object
readonly
Returns the value of attribute x1.
-
#x2 ⇒ Object
readonly
Returns the value of attribute x2.
-
#x3 ⇒ Object
readonly
Returns the value of attribute x3.
-
#y1 ⇒ Object
readonly
Returns the value of attribute y1.
-
#y2 ⇒ Object
readonly
Returns the value of attribute y2.
-
#y3 ⇒ Object
readonly
Returns the value of attribute y3.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(x1:, y1:, x2:, y2:, x3:, y3:) ⇒ Curveto
constructor
A new instance of Curveto.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(x1:, y1:, x2:, y2:, x3:, y3:) ⇒ Curveto
Returns a new instance of Curveto.
74 75 76 77 78 79 80 81 82 |
# File 'lib/postscript/model/operators/path.rb', line 74 def initialize(x1:, y1:, x2:, y2:, x3:, y3:) @x1 = x1 @y1 = y1 @x2 = x2 @y2 = y2 @x3 = x3 @y3 = y3 freeze end |
Instance Attribute Details
#x1 ⇒ Object (readonly)
Returns the value of attribute x1.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def x1 @x1 end |
#x2 ⇒ Object (readonly)
Returns the value of attribute x2.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def x2 @x2 end |
#x3 ⇒ Object (readonly)
Returns the value of attribute x3.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def x3 @x3 end |
#y1 ⇒ Object (readonly)
Returns the value of attribute y1.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def y1 @y1 end |
#y2 ⇒ Object (readonly)
Returns the value of attribute y2.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def y2 @y2 end |
#y3 ⇒ Object (readonly)
Returns the value of attribute y3.
73 74 75 |
# File 'lib/postscript/model/operators/path.rb', line 73 def y3 @y3 end |
Class Method Details
.from_operands(stack) ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/postscript/model/operators/path.rb', line 83 def self.from_operands(stack) y3 = stack.pop_number x3 = stack.pop_number y2 = stack.pop_number x2 = stack.pop_number y1 = stack.pop_number x1 = stack.pop_number new(x1: x1, y1: y1, x2: x2, y2: y2, x3: x3, y3: y3) end |