Class: PEG::Node
- Inherits:
-
ValueObject
- Object
- ValueObject
- PEG::Node
- Defined in:
- lib/peg.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#name ⇒ Object
Returns the value of attribute name.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, children = [], name = nil) ⇒ Node
constructor
A new instance of Node.
- #inspect ⇒ Object
Methods inherited from ValueObject
Constructor Details
#initialize(text, children = [], name = nil) ⇒ Node
Returns a new instance of Node.
11 12 13 |
# File 'lib/peg.rb', line 11 def initialize(text, children=[], name=nil) @text, @children, @name = text, children, name end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
9 10 11 |
# File 'lib/peg.rb', line 9 def children @children end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/peg.rb', line 9 def name @name end |
#text ⇒ Object
Returns the value of attribute text.
9 10 11 |
# File 'lib/peg.rb', line 9 def text @text end |
Instance Method Details
#inspect ⇒ Object
15 16 17 |
# File 'lib/peg.rb', line 15 def inspect "#{self.class}.new(#{text.inspect}, #{children.inspect}, #{name.inspect})" end |