Class: Foxtail::Syntax::Parser::AST::Term
- Inherits:
-
SyntaxNode
- Object
- BaseNode
- SyntaxNode
- Foxtail::Syntax::Parser::AST::Term
- Defined in:
- lib/foxtail/syntax/parser/ast/term.rb
Overview
Represents a Fluent term with an identifier, value pattern, optional attributes, and an optional comment
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#id ⇒ Object
Returns the value of attribute id.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from SyntaxNode
Attributes inherited from BaseNode
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(id, value, attributes = [], comment = nil) ⇒ Term
constructor
A new instance of Term.
Methods inherited from SyntaxNode
Methods inherited from BaseNode
Constructor Details
#initialize(id, value, attributes = [], comment = nil) ⇒ Term
Returns a new instance of Term.
15 16 17 18 19 20 21 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 15 def initialize(id, value, attributes=[], comment=nil) super() @id = id @value = value @attributes = attributes @comment = comment end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
12 13 14 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 12 def attributes @attributes end |
#comment ⇒ Object
Returns the value of attribute comment.
13 14 15 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 13 def comment @comment end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 10 def id @id end |
#value ⇒ Object
Returns the value of attribute value.
11 12 13 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 11 def value @value end |
Instance Method Details
#children ⇒ Object
23 |
# File 'lib/foxtail/syntax/parser/ast/term.rb', line 23 def children = [id, value, *attributes, comment].compact |