Class: Postscript::Model::Operators::Container::Astore
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Container::Astore
- Defined in:
- lib/postscript/model/operators/container.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(array:, length:) ⇒ Astore
constructor
A new instance of Astore.
Methods inherited from Postscript::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/postscript/model/operators/container.rb', line 103 def initialize(array:, length:) @array = array @length = length freeze end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
102 103 104 |
# File 'lib/postscript/model/operators/container.rb', line 102 def array @array end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
102 103 104 |
# File 'lib/postscript/model/operators/container.rb', line 102 def length @length end |
Class Method Details
.from_operands(stack) ⇒ Object
108 109 110 111 112 |
# File 'lib/postscript/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 |