Class: Postscript::Model::Operators::Path::Arc
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Path::Arc
- Defined in:
- lib/postscript/model/operators/path.rb
Instance Attribute Summary collapse
-
#angle1 ⇒ Object
readonly
Returns the value of attribute angle1.
-
#angle2 ⇒ Object
readonly
Returns the value of attribute angle2.
-
#radius ⇒ Object
readonly
Returns the value of attribute radius.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(x:, y:, radius:, angle1:, angle2:) ⇒ Arc
constructor
A new instance of Arc.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(x:, y:, radius:, angle1:, angle2:) ⇒ Arc
Returns a new instance of Arc.
120 121 122 123 124 125 126 127 |
# File 'lib/postscript/model/operators/path.rb', line 120 def initialize(x:, y:, radius:, angle1:, angle2:) @x = x @y = y @radius = radius @angle1 = angle1 @angle2 = angle2 freeze end |
Instance Attribute Details
#angle1 ⇒ Object (readonly)
Returns the value of attribute angle1.
119 120 121 |
# File 'lib/postscript/model/operators/path.rb', line 119 def angle1 @angle1 end |
#angle2 ⇒ Object (readonly)
Returns the value of attribute angle2.
119 120 121 |
# File 'lib/postscript/model/operators/path.rb', line 119 def angle2 @angle2 end |
#radius ⇒ Object (readonly)
Returns the value of attribute radius.
119 120 121 |
# File 'lib/postscript/model/operators/path.rb', line 119 def radius @radius end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
119 120 121 |
# File 'lib/postscript/model/operators/path.rb', line 119 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
119 120 121 |
# File 'lib/postscript/model/operators/path.rb', line 119 def y @y end |
Class Method Details
.from_operands(stack) ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/postscript/model/operators/path.rb', line 128 def self.from_operands(stack) angle2 = stack.pop_number angle1 = stack.pop_number radius = stack.pop_number y = stack.pop_number x = stack.pop_number new(x: x, y: y, radius: radius, angle1: angle1, angle2: angle2) end |