Class: Postsvg::Model::Operators::Transformations::Translate
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Transformations::Translate
- Defined in:
- lib/postsvg/model/operators/transformations.rb
Instance Attribute Summary collapse
-
#tx ⇒ Object
readonly
Returns the value of attribute tx.
-
#ty ⇒ Object
readonly
Returns the value of attribute ty.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tx:, ty:) ⇒ Translate
constructor
A new instance of Translate.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(tx:, ty:) ⇒ Translate
Returns a new instance of Translate.
10 11 12 13 14 |
# File 'lib/postsvg/model/operators/transformations.rb', line 10 def initialize(tx:, ty:) @tx = tx @ty = ty freeze end |
Instance Attribute Details
#tx ⇒ Object (readonly)
Returns the value of attribute tx.
9 10 11 |
# File 'lib/postsvg/model/operators/transformations.rb', line 9 def tx @tx end |
#ty ⇒ Object (readonly)
Returns the value of attribute ty.
9 10 11 |
# File 'lib/postsvg/model/operators/transformations.rb', line 9 def ty @ty end |
Class Method Details
.from_operands(stack) ⇒ Object
15 16 17 18 19 |
# File 'lib/postsvg/model/operators/transformations.rb', line 15 def self.from_operands(stack) ty = stack.pop_number tx = stack.pop_number new(tx: tx, ty: ty) end |