Class: Postsvg::Model::Operators::Container::Astore

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/container.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(array:, length:) ⇒ Astore

Returns a new instance of Astore.



103
104
105
106
107
# File 'lib/postsvg/model/operators/container.rb', line 103

def initialize(array:, length:)
  @array = array
  @length = length
  freeze
end

Instance Attribute Details

#arrayObject (readonly)

Returns the value of attribute array.



102
103
104
# File 'lib/postsvg/model/operators/container.rb', line 102

def array
  @array
end

#lengthObject (readonly)

Returns the value of attribute length.



102
103
104
# File 'lib/postsvg/model/operators/container.rb', line 102

def length
  @length
end

Class Method Details

.from_operands(stack) ⇒ Object



108
109
110
111
112
# File 'lib/postsvg/model/operators/container.rb', line 108

def self.from_operands(stack)
  arr = stack.pop
  length = stack.pop_number.to_i
  new(array: arr, length: length)
end