Class: Postscript::Model::Operators::Container::Get
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Container::Get
- Defined in:
- lib/postscript/model/operators/container.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operand:, key:) ⇒ Get
constructor
A new instance of Get.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:, key:) ⇒ Get
Returns a new instance of Get.
22 23 24 25 26 |
# File 'lib/postscript/model/operators/container.rb', line 22 def initialize(operand:, key:) @operand = operand @key = key freeze end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
21 22 23 |
# File 'lib/postscript/model/operators/container.rb', line 21 def key @key end |
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
21 22 23 |
# File 'lib/postscript/model/operators/container.rb', line 21 def operand @operand end |
Class Method Details
.from_operands(stack) ⇒ Object
27 28 29 30 31 |
# File 'lib/postscript/model/operators/container.rb', line 27 def self.from_operands(stack) key = stack.pop coll = stack.pop new(operand: coll, key: key) end |