Class: Postsvg::Model::Operators::Path::Moveto
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Path::Moveto
- Defined in:
- lib/postsvg/model/operators/path.rb
Instance Attribute Summary collapse
-
#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:) ⇒ Moveto
constructor
A new instance of Moveto.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(x:, y:) ⇒ Moveto
Returns a new instance of Moveto.
14 15 16 17 18 |
# File 'lib/postsvg/model/operators/path.rb', line 14 def initialize(x:, y:) @x = x @y = y freeze end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
13 14 15 |
# File 'lib/postsvg/model/operators/path.rb', line 13 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
13 14 15 |
# File 'lib/postsvg/model/operators/path.rb', line 13 def y @y end |
Class Method Details
.from_operands(stack) ⇒ Object
19 20 21 22 23 |
# File 'lib/postsvg/model/operators/path.rb', line 19 def self.from_operands(stack) y = stack.pop_number x = stack.pop_number new(x: x, y: y) end |