Class: Postscript::Model::Operators::Dictionary::Known
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Dictionary::Known
- Defined in:
- lib/postscript/model/operators/dictionary.rb
Instance Attribute Summary collapse
-
#dict ⇒ Object
readonly
Returns the value of attribute dict.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key:, dict:) ⇒ Known
constructor
A new instance of Known.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(key:, dict:) ⇒ Known
Returns a new instance of Known.
81 82 83 84 85 |
# File 'lib/postscript/model/operators/dictionary.rb', line 81 def initialize(key:, dict:) @key = key @dict = dict freeze end |
Instance Attribute Details
#dict ⇒ Object (readonly)
Returns the value of attribute dict.
80 81 82 |
# File 'lib/postscript/model/operators/dictionary.rb', line 80 def dict @dict end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
80 81 82 |
# File 'lib/postscript/model/operators/dictionary.rb', line 80 def key @key end |
Class Method Details
.from_operands(stack) ⇒ Object
75 76 77 78 79 |
# File 'lib/postscript/model/operators/dictionary.rb', line 75 def self.from_operands(stack) key = stack.pop dict = stack.pop new(key: key, dict: dict) end |