class Highway::Compiler::Analyze::Tree::Values::Array

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

Attributes

children[R]

The array of child values.

@return [Array<Highway::Compiler::Analyze::Tree::Values::*>]

Public Class Methods

new(children) click to toggle source

Initialize an instance.

@param children [Array<Highway::Compiler::Analyze::Tree::Values::*>] The array of child values.

# File lib/highway/compiler/analyze/tree/values/array.rb, line 23
def initialize(children)
  @children = children
end

Public Instance Methods

flatten_segments() click to toggle source

The flat array of all segments.

@return [Array<Highway::Compiler::Analyze::Tree::Segments::*>]

# File lib/highway/compiler/analyze/tree/values/array.rb, line 35
def flatten_segments
  @children.flat_map(&:flatten_segments)
end