Class: Postsvg::Model::Operators::Dictionary::Known

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/dictionary.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(key:, dict:) ⇒ Known

Returns a new instance of Known.



81
82
83
84
85
# File 'lib/postsvg/model/operators/dictionary.rb', line 81

def initialize(key:, dict:)
  @key = key
  @dict = dict
  freeze
end

Instance Attribute Details

#dictObject (readonly)

Returns the value of attribute dict.



80
81
82
# File 'lib/postsvg/model/operators/dictionary.rb', line 80

def dict
  @dict
end

#keyObject (readonly)

Returns the value of attribute key.



80
81
82
# File 'lib/postsvg/model/operators/dictionary.rb', line 80

def key
  @key
end

Class Method Details

.from_operands(stack) ⇒ Object



75
76
77
78
79
# File 'lib/postsvg/model/operators/dictionary.rb', line 75

def self.from_operands(stack)
  key = stack.pop
  dict = stack.pop
  new(key: key, dict: dict)
end