Class: Foxtail::Syntax::Parser::AST::MessageReference

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

Overview

Represents references to messages with optional attribute access

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, attribute = nil) ⇒ MessageReference

Returns a new instance of MessageReference.



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

def initialize(id, attribute=nil)
  super()
  @id = id
  @attribute = attribute
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



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

def attribute
  @attribute
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/foxtail/syntax/parser/ast/message_reference.rb', line 9

def id
  @id
end

Instance Method Details

#childrenObject



18
# File 'lib/foxtail/syntax/parser/ast/message_reference.rb', line 18

def children = [id, attribute].compact