Class: Ruote::RadialReader::Node
- Inherits:
-
Object
- Object
- Ruote::RadialReader::Node
- Defined in:
- lib/ruote/reader/radial.rb
Overview
A helper class to store the temporary tree while it gets read.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#indentation ⇒ Object
readonly
Returns the value of attribute indentation.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(indentation, expname, attributes) ⇒ Node
constructor
A new instance of Node.
- #to_a ⇒ Object
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
#children ⇒ Object (readonly)
Returns the value of attribute children.
130 131 132 |
# File 'lib/ruote/reader/radial.rb', line 130 def children @children end |
#indentation ⇒ Object (readonly)
Returns the value of attribute indentation.
130 131 132 |
# File 'lib/ruote/reader/radial.rb', line 130 def indentation @indentation end |
#parent ⇒ Object
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_a ⇒ Object
148 149 150 151 |
# File 'lib/ruote/reader/radial.rb', line 148 def to_a [ @expname, @attributes, @children.collect { |c| c.to_a } ] end |