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.
39 40 41 42 43 44 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 39 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.
37 38 39 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 37 def children @children end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
37 38 39 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 37 def location @location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
37 38 39 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 37 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
37 38 39 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 37 def value @value end |
Instance Method Details
#add_child(child) ⇒ Object
46 47 48 |
# File 'lib/rhales/parsers/handlebars_parser.rb', line 46 def add_child(child) @children << child end |