class IcAgent::Ast::Nodes::NamedNode

Represents a named node in the abstract syntax tree.

Public Instance Methods

elements_to_s() click to toggle source
# File lib/ic_agent/ast/nodes/named_nodes.rb, line 23
def elements_to_s
  elements.map(&:to_s).join("\n")
end
source_content() click to toggle source
# File lib/ic_agent/ast/nodes/named_nodes.rb, line 27
def source_content
  self.text_value.strip
end
title() click to toggle source

The title of the named node.

# File lib/ic_agent/ast/nodes/named_nodes.rb, line 9
def title
  :named_node
end
to_array() click to toggle source

Converts the node and its children to an array representation.

# File lib/ic_agent/ast/nodes/named_nodes.rb, line 14
def to_array
  [title] + elements.map(&:to_array)
end
to_s() click to toggle source

Converts the node and its children to a string representation.

# File lib/ic_agent/ast/nodes/named_nodes.rb, line 19
def to_s
  "#{title.to_s.upcase} #{elements_to_s}"
end