Class: Foxtail::Syntax::Parser::AST::Message

Inherits:
SyntaxNode show all
Defined in:
lib/foxtail/syntax/parser/ast/message.rb

Overview

Represents a Fluent message with an identifier, optional value pattern, attributes, and an optional comment

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#span

Attributes inherited from BaseNode

#type

Instance Method Summary collapse

Methods inherited from SyntaxNode

#add_span

Methods inherited from BaseNode

#==, #accept, #to_h

Constructor Details

#initialize(id, value = nil, attributes = [], comment = nil) ⇒ Message

Returns a new instance of Message.



15
16
17
18
19
20
21
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 15

def initialize(id, value=nil, attributes=[], comment=nil)
  super()
  @id = id
  @value = value
  @attributes = attributes
  @comment = comment
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



12
13
14
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 12

def attributes
  @attributes
end

#commentObject

Returns the value of attribute comment.



13
14
15
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 13

def comment
  @comment
end

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 10

def id
  @id
end

#valueObject

Returns the value of attribute value.



11
12
13
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 11

def value
  @value
end

Instance Method Details

#childrenObject



23
# File 'lib/foxtail/syntax/parser/ast/message.rb', line 23

def children = [id, value, *attributes, comment].compact