Class: Foxtail::Bundle::Parser::AST::Term
- Inherits:
-
Data
- Object
- Data
- Foxtail::Bundle::Parser::AST::Term
- Defined in:
- lib/foxtail/bundle/parser/ast.rb,
lib/foxtail/bundle/parser/ast.rb
Overview
Term entry in fluent-bundle compatible format
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
- Hash, nil
-
Term attributes.
-
#id ⇒ Object
readonly
- String
-
The term identifier (with - prefix).
-
#value ⇒ Object
readonly
The term pattern (String or Array).
Instance Method Summary collapse
-
#initialize(id:, value:, attributes: nil) ⇒ Term
constructor
A new instance of Term.
Constructor Details
#initialize(id:, value:, attributes: nil) ⇒ Term
Returns a new instance of Term.
123 124 125 126 127 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 123 def initialize(id:, value:, attributes: nil) term_id = id.to_s term_id = "-#{term_id}" unless term_id.start_with?("-") super(id: term_id, value:, attributes:) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
- Hash, nil
-
Term attributes
119 120 121 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 119 def attributes @attributes end |
#id ⇒ Object (readonly)
- String
-
The term identifier (with - prefix)
119 120 121 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 119 def id @id end |
#value ⇒ Object (readonly)
The term pattern (String or Array)
119 120 121 |
# File 'lib/foxtail/bundle/parser/ast.rb', line 119 def value @value end |