Class: Ruote::RadialReader::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/ruote/reader/radial.rb

Overview

A helper class to store the temporary tree while it gets read.

Direct Known Subclasses

PreRoot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(indentation, expname, attributes) ⇒ Node

Returns a new instance of Node.



132
133
134
135
136
137
138
139
140
# File 'lib/ruote/reader/radial.rb', line 132

def initialize(indentation, expname, attributes)

  @parent = nil
  @indentation = indentation
  @children = []

  @expname = expname.gsub(/-/, '_')
  @attributes = attributes
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



130
131
132
# File 'lib/ruote/reader/radial.rb', line 130

def children
  @children
end

#indentationObject (readonly)

Returns the value of attribute indentation.



130
131
132
# File 'lib/ruote/reader/radial.rb', line 130

def indentation
  @indentation
end

#parentObject

Returns the value of attribute parent.



130
131
132
# File 'lib/ruote/reader/radial.rb', line 130

def parent
  @parent
end

Instance Method Details

#to_aObject



148
149
150
151
# File 'lib/ruote/reader/radial.rb', line 148

def to_a

  [ @expname, @attributes, @children.collect { |c| c.to_a } ]
end