Class: Highway::Compiler::Analyze::Tree::Values::Array

Inherits:
Base
  • Object
show all
Defined in:
lib/highway/compiler/analyze/tree/values/array.rb

Overview

This class represents an array value in the semantic tree. It consists of an array of child values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#select_segments, #select_variable_segments, #select_variable_segments_with_scope

Constructor Details

#initialize(children) ⇒ Array

Initialize an instance.

Parameters:



23
24
25
# File 'lib/highway/compiler/analyze/tree/values/array.rb', line 23

def initialize(children)
  @children = children
end

Instance Attribute Details

#childrenArray<Highway::Compiler::Analyze::Tree::Values::*> (readonly)

The array of child values.



30
31
32
# File 'lib/highway/compiler/analyze/tree/values/array.rb', line 30

def children
  @children
end

Instance Method Details

#flatten_segmentsArray<Highway::Compiler::Analyze::Tree::Segments::*>

The flat array of all segments.



35
36
37
# File 'lib/highway/compiler/analyze/tree/values/array.rb', line 35

def flatten_segments
  @children.flat_map(&:flatten_segments)
end