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.
143 144 145 146 147 148 149 150 151 152 |
# File 'lib/ruote/reader/radial.rb', line 143 def initialize(indentation, expname, attributes) @parent = nil @indentation = indentation @children = [] @expname = expname#.gsub(/-/, '_') @expname.gsub!(/-/, '_') if @expname.match(/^[a-z\-]+$/) @attributes = attributes end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
141 142 143 |
# File 'lib/ruote/reader/radial.rb', line 141 def children @children end |
#indentation ⇒ Object (readonly)
Returns the value of attribute indentation.
141 142 143 |
# File 'lib/ruote/reader/radial.rb', line 141 def indentation @indentation end |
#parent ⇒ Object
Returns the value of attribute parent.
141 142 143 |
# File 'lib/ruote/reader/radial.rb', line 141 def parent @parent end |
Instance Method Details
#to_a ⇒ Object
160 161 162 163 |
# File 'lib/ruote/reader/radial.rb', line 160 def to_a [ @expname, @attributes, @children.collect { |c| c.to_a } ] end |