Class: Postsvg::Model::Operators::Transformations::Scale

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/transformations.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#sxObject (readonly)

Returns the value of attribute sx.



24
25
26
# File 'lib/postsvg/model/operators/transformations.rb', line 24

def sx
  @sx
end

#syObject (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