Class: Postsvg::Model::Operators::Path::Lineto
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Path::Lineto
- 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:) ⇒ Lineto
constructor
A new instance of Lineto.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(x:, y:) ⇒ Lineto
Returns a new instance of Lineto.
44 45 46 47 48 |
# File 'lib/postsvg/model/operators/path.rb', line 44 def initialize(x:, y:) @x = x @y = y freeze end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
43 44 45 |
# File 'lib/postsvg/model/operators/path.rb', line 43 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
43 44 45 |
# File 'lib/postsvg/model/operators/path.rb', line 43 def y @y end |
Class Method Details
.from_operands(stack) ⇒ Object
49 50 51 52 53 |
# File 'lib/postsvg/model/operators/path.rb', line 49 def self.from_operands(stack) y = stack.pop_number x = stack.pop_number new(x: x, y: y) end |