Class: Ruote::RadialReader::PreRoot
- Defined in:
- lib/ruote/reader/radial.rb
Overview
Some kind of “root container”, to avoid having to deal with nils and making the parsing code more complicated (hopefully).
Instance Attribute Summary
Attributes inherited from Node
#children, #indentation, #parent
Instance Method Summary collapse
-
#initialize(first_line) ⇒ PreRoot
constructor
A new instance of PreRoot.
- #to_a ⇒ Object
Constructor Details
#initialize(first_line) ⇒ PreRoot
Returns a new instance of PreRoot.
220 221 222 223 224 225 226 227 |
# File 'lib/ruote/reader/radial.rb', line 220 def initialize(first_line) @first_line = first_line @parent = nil @indentation = -1 @children = [] end |
Instance Method Details
#to_a ⇒ Object
229 230 231 232 233 234 235 236 |
# File 'lib/ruote/reader/radial.rb', line 229 def to_a raise ArgumentError.new( "couldn't parse process definition out of >#{@first_line}<" ) unless @children.first @children.first.to_a end |