Class: Foxtail::Syntax::Parser::AST::Attribute

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

Overview

Represents attributes of messages and terms (e.g., .attr = value)

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) ⇒ Attribute

Returns a new instance of Attribute.



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

def initialize(id, value)
  super()
  @id = id
  @value = value
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#childrenObject



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

def children = [id, value]