class

Ameba::AST::Argument

Inherits Reference < Object

Represents the argument of some node. Holds the reference to the variable, thus to scope.

For example, all these vars are arguments:

def method(a, b, c = 10, &block)
  3.times do |i|
  end

  ->(x : Int32) { }
end

Constructors

new(node : Crystal::ASTNode, variable : Ameba::AST::Variable)

Creates a new argument.

Argument.new(node, variable)
Source

Instance methods

anonymous?

Returns true if the name is empty, false otherwise.

Source
end_location(*args, **options)
Source
end_location(*args, **options, &)
Source
ignored?

Returns true if the name starts with '_', false otherwise.

Source
location(*args, **options)
Source
location(*args, **options, &)
Source
name

Name of the argument.

Source
node

The actual node.

Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source
variable

Variable of this argument (may be the same node)

Source