Ameba::AST::Argument - ameba 1.7.0

# class Ameba::AST::Argument

- Ameba::AST::Argument
- Reference
- Object

##
Overview

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

##
Defined in:

ameba/ast/variabling/argument.cr

##
Constructors

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

  Creates a new argument.

##
Instance Method Summary

- #anonymous?

  Returns `true` if the `#name` is empty, `false` otherwise.

- #end_location(*args, **options)
- #end_location(*args, **options, &)
- #ignored?

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

- #location(*args, **options)
- #location(*args, **options, &)
- #name

  Name of the argument.

- #node : Crystal::Var | Crystal::Arg

  The actual node.

- #to_s(*args, **options)
- #to_s(*args, **options, &)
- #variable : Variable

  Variable of this argument (may be the same node)

##
Constructor Detail

def self.new(node : Crystal::ASTNode, variable : Ameba::AST::Variable) #

Creates a new argument.

    Argument.new(node, variable)

##
Instance Method Detail

def anonymous? #

Returns `true` if the `#name` is empty, `false` otherwise.

def end_location(*args, **options) #
def end_location(*args, **options, &) #
def ignored? #

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

def location(*args, **options) #
def location(*args, **options, &) #
def name #

Name of the argument.

def node : Crystal::Var | Crystal::Arg #

The actual node.

def to_s(*args, **options) #
def to_s(*args, **options, &) #
def variable : Variable #

Variable of this argument (may be the same node)