Skip to content

class Crystal::Arg
inherits Crystal::ASTNode

A def argument.

Included modules

Crystal::SpecialVar

Class methods

.new(name : String, default_value : ASTNode? = nil, restriction : ASTNode? = nil, external_name : String? = nil, type : Type? = nil)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

#accept_children(visitor)

View source

#clone_without_location

View source

#default_value : ASTNode?

View source

#default_value=(default_value : ASTNode?)

View source

#doc : String?

Returns the doc comment attached to this node. Not every node supports having doc comments, so by default this returns nil.

View source

#doc=(doc : String?)

View source

#external_name : String

View source

#external_name=(external_name : String)

View source

#hash(hasher)

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source

#name : String

The internal name

View source

#name=(name : String)

The internal name

View source

#name_size

View source

#restriction : ASTNode?

View source

#restriction=(restriction : ASTNode?)

View source

#to_json(builder : JSON::Builder)

View source