Class: Highway::Compiler::Analyze::Tree::Values::Hash
- Defined in:
- lib/highway/compiler/analyze/tree/values/hash.rb
Overview
This class represents a hash value in the semantic tree. It consists of an array of child values.
Instance Attribute Summary collapse
-
#children ⇒ Hash<String, Highway::Compiler::Analyze::Tree::Values::*>
readonly
The array of child values.
Instance Method Summary collapse
-
#flatten_segments ⇒ Array<Highway::Compiler::Analyze::Tree::Segments::*>
The flat array of all segments.
-
#initialize(children) ⇒ Hash
constructor
Initialize an instance.
Methods inherited from Base
#select_segments, #select_variable_segments, #select_variable_segments_with_scope
Constructor Details
#initialize(children) ⇒ Hash
Initialize an instance.
23 24 25 |
# File 'lib/highway/compiler/analyze/tree/values/hash.rb', line 23 def initialize(children) @children = children end |
Instance Attribute Details
#children ⇒ Hash<String, Highway::Compiler::Analyze::Tree::Values::*> (readonly)
The array of child values.
30 31 32 |
# File 'lib/highway/compiler/analyze/tree/values/hash.rb', line 30 def children @children end |
Instance Method Details
#flatten_segments ⇒ Array<Highway::Compiler::Analyze::Tree::Segments::*>
The flat array of all segments.
35 36 37 |
# File 'lib/highway/compiler/analyze/tree/values/hash.rb', line 35 def flatten_segments @children.values.flat_map(&:flatten_segments) end |