Class: Postsvg::Model::Operators::Transformations::Scale
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Transformations::Scale
- Defined in:
- lib/postsvg/model/operators/transformations.rb
Instance Attribute Summary collapse
-
#sx ⇒ Object
readonly
Returns the value of attribute sx.
-
#sy ⇒ Object
readonly
Returns the value of attribute sy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(sx:, sy:) ⇒ Scale
constructor
A new instance of Scale.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(sx:, sy:) ⇒ Scale
Returns a new instance of Scale.
25 26 27 28 29 |
# File 'lib/postsvg/model/operators/transformations.rb', line 25 def initialize(sx:, sy:) @sx = sx @sy = sy freeze end |
Instance Attribute Details
#sx ⇒ Object (readonly)
Returns the value of attribute sx.
24 25 26 |
# File 'lib/postsvg/model/operators/transformations.rb', line 24 def sx @sx end |
#sy ⇒ Object (readonly)
Returns the value of attribute sy.
24 25 26 |
# File 'lib/postsvg/model/operators/transformations.rb', line 24 def sy @sy end |
Class Method Details
.from_operands(stack) ⇒ Object
30 31 32 33 34 |
# File 'lib/postsvg/model/operators/transformations.rb', line 30 def self.from_operands(stack) sy = stack.pop_number sx = stack.pop_number new(sx: sx, sy: sy) end |