Class: Code::Node::Dictionnary
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::Dictionnary
- Defined in:
- lib/code/node/dictionnary.rb
Defined Under Namespace
Classes: KeyValue
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(parsed) ⇒ Dictionnary
constructor
A new instance of Dictionnary.
Constructor Details
#initialize(parsed) ⇒ Dictionnary
Returns a new instance of Dictionnary.
20 21 22 23 24 |
# File 'lib/code/node/dictionnary.rb', line 20 def initialize(parsed) parsed = [] if parsed == "" @key_values = parsed.map { |key_value| Node::Dictionnary::KeyValue.new(key_value) } end |
Instance Method Details
#evaluate(**args) ⇒ Object
26 27 28 29 30 |
# File 'lib/code/node/dictionnary.rb', line 26 def evaluate(**args) ::Code::Object::Dictionnary.new( @key_values.map { |key_value| key_value.evaluate(**args) }.to_h ) end |