Class: Postscript::Model::Operators::Dictionary::Store
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Dictionary::Store
- Defined in:
- lib/postscript/model/operators/dictionary.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key:, value:) ⇒ Store
constructor
A new instance of Store.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(key:, value:) ⇒ Store
Returns a new instance of Store.
61 62 63 64 65 |
# File 'lib/postscript/model/operators/dictionary.rb', line 61 def initialize(key:, value:) @key = key @value = value freeze end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
60 61 62 |
# File 'lib/postscript/model/operators/dictionary.rb', line 60 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
60 61 62 |
# File 'lib/postscript/model/operators/dictionary.rb', line 60 def value @value end |
Class Method Details
.from_operands(stack) ⇒ Object
66 67 68 69 70 |
# File 'lib/postscript/model/operators/dictionary.rb', line 66 def self.from_operands(stack) value = stack.pop key = stack.pop new(key: key, value: value) end |