Class: Foxtail::Bundle::Parser::AST::MessageReference

Inherits:
Data
  • Object
show all
Defined in:
lib/foxtail/bundle/parser/ast.rb,
lib/foxtail/bundle/parser/ast.rb

Overview

Message reference expression (message) in Fluent patterns

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, attr: nil) ⇒ MessageReference

Returns a new instance of MessageReference.

Parameters:

  • name (#to_s)

    The message identifier (will be converted to String)

  • attr (#to_s, nil) (defaults to: nil)

    The attribute name (default: nil)



59
# File 'lib/foxtail/bundle/parser/ast.rb', line 59

def initialize(name:, attr: nil) = super(name: name.to_s, attr: attr&.to_s)

Instance Attribute Details

#attrObject (readonly)

String, nil

The attribute name if accessing an attribute



56
57
58
# File 'lib/foxtail/bundle/parser/ast.rb', line 56

def attr
  @attr
end

#nameObject (readonly)

String

The message identifier



56
57
58
# File 'lib/foxtail/bundle/parser/ast.rb', line 56

def name
  @name
end