Class: Foxtail::Syntax::Parser::AST::NamedArgument

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

Overview

Represents named arguments in function calls (e.g., arg: 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(name, value) ⇒ NamedArgument

Returns a new instance of NamedArgument.



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

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#childrenObject



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

def children = [name, value]