Class: Rhales::HandlebarsParser::Node
- Inherits:
-
Object
- Object
- Rhales::HandlebarsParser::Node
- Defined in:
- lib/rhales/parsers/handlebars_parser.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#add_child(child) ⇒ Object
-
#initialize(type, location, value: nil, children: []) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(type, location, value: nil, children: []) ⇒ Node
Returns a new instance of Node.
37 38 39 40 41 42 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 37 def initialize(type, location, value: nil, children: []) @type = type @location = location @value = value @children = children end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
35 36 37 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 35 def children @children end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
35 36 37 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 35 def location @location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
35 36 37 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 35 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
35 36 37 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 35 def value @value end |
Instance Method Details
#add_child(child) ⇒ Object
44 45 46 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 44 def add_child(child) @children << child end |