Class: Bai2::Parser::ParseNode
- Inherits:
-
Object
- Object
- Bai2::Parser::ParseNode
- Defined in:
- lib/bai2/parser.rb
Overview
Wrapper object to represent a tree node.
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#records ⇒ Object
Returns the value of attribute records.
Instance Method Summary collapse
-
#initialize(record) ⇒ ParseNode
constructor
A new instance of ParseNode.
Constructor Details
#initialize(record) ⇒ ParseNode
Returns a new instance of ParseNode.
13 14 15 16 |
# File 'lib/bai2/parser.rb', line 13 def initialize(record) @code, @records = record.code, [record] @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
18 19 20 |
# File 'lib/bai2/parser.rb', line 18 def children @children end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
17 18 19 |
# File 'lib/bai2/parser.rb', line 17 def code @code end |
#records ⇒ Object
Returns the value of attribute records.
18 19 20 |
# File 'lib/bai2/parser.rb', line 18 def records @records end |