Class: Foxtail::Bundle::Parser::AST::TermReference

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

Overview

Term reference expression (-term) in Fluent patterns

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, attr: nil, args: []) ⇒ TermReference

Returns a new instance of TermReference.

Parameters:

  • name (#to_s)

    The term name (will be converted to String)

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

    The attribute name (default: nil)

  • args (Array) (defaults to: [])

    Arguments passed to the term (default: [])



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

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

Instance Attribute Details

#argsObject (readonly)

Array

Arguments passed to the term



44
45
46
# File 'lib/foxtail/bundle/parser/ast.rb', line 44

def args
  @args
end

#attrObject (readonly)

String, nil

The attribute name if accessing an attribute



44
45
46
# File 'lib/foxtail/bundle/parser/ast.rb', line 44

def attr
  @attr
end

#nameObject (readonly)

String

The term name (without - prefix)



44
45
46
# File 'lib/foxtail/bundle/parser/ast.rb', line 44

def name
  @name
end