Class: Postsvg::Model::Operators::Container::Put
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Container::Put
- Defined in:
- lib/postsvg/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.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operand:, key:, value:) ⇒ Put
constructor
A new instance of Put.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(operand:, key:, value:) ⇒ Put
Returns a new instance of Put.
37 38 39 40 41 42 |
# File 'lib/postsvg/model/operators/container.rb', line 37 def initialize(operand:, key:, value:) @operand = operand @key = key @value = value freeze end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
36 37 38 |
# File 'lib/postsvg/model/operators/container.rb', line 36 def key @key end |
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
36 37 38 |
# File 'lib/postsvg/model/operators/container.rb', line 36 def operand @operand end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
36 37 38 |
# File 'lib/postsvg/model/operators/container.rb', line 36 def value @value end |
Class Method Details
.from_operands(stack) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/postsvg/model/operators/container.rb', line 43 def self.from_operands(stack) value = stack.pop key = stack.pop coll = stack.pop new(operand: coll, key: key, value: value) end |