Class: Postsvg::Model::Operators::Dictionary::Store

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:, value:) ⇒ Store

Returns a new instance of Store.



61
62
63
64
65
# File 'lib/postsvg/model/operators/dictionary.rb', line 61

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



60
61
62
# File 'lib/postsvg/model/operators/dictionary.rb', line 60

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



60
61
62
# File 'lib/postsvg/model/operators/dictionary.rb', line 60

def value
  @value
end

Class Method Details

.from_operands(stack) ⇒ Object



66
67
68
69
70
# File 'lib/postsvg/model/operators/dictionary.rb', line 66

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