Syntax::Def
Inherits Syntax::ASTNode < Reference < Object
A method definition.
'def' [ receiver '.' ] name
body
'end'
| 'def' [ receiver '.' ] name '(' [ arg [ ',' arg ]* ] ')' body 'end'
Constructors
new(name : String, args : Array(Syntax::Arg) = [] of Arg, body = nil, receiver : Syntax::ASTNode | Nil = nil, block_arg : Nil | Syntax::Arg = nil, return_type : Syntax::ASTNode | Nil = nil, macro_def : Bool = false, yields : Int32 | Nil = nil, abstract __arg24 : Bool = false, splat_index : Int32 | Nil = nil, double_splat : Nil | Syntax::Arg = nil, free_vars : Nil | Array(String) = nil)
SourceInstance methods
==(other : self)
Returns true if this reference is the same as other. Invokes same?.
abstract?
Sourceaccept_children(visitor)
Sourceargs
Sourceassigns_special_var?
Sourceblock_arg
Sourceblock_arg=(block_arg : Arg | Nil)
Sourcebody
Sourcebody=(body : ASTNode)
Sourcecalls_initialize?
Sourcecalls_previous_def?
Sourcecalls_super?
Sourceclone_without_location
Sourcedoc
Returns the doc comment attached to this node. Not every node
supports having doc comments, so by default this returns nil.
double_splat
Sourcedouble_splat=(double_splat : Arg | Nil)
Sourcefree_vars
Sourcehash(hasher)
See Object#hash(hasher)
macro_def?
Sourcename
Sourcename_location
Sourcename_location=(name_location : Location | Nil)
Sourcename_size
Sourcereceiver
Sourcereceiver=(receiver : ASTNode | Nil)
Sourcereturn_type
Sourcereturn_type=(return_type : ASTNode | Nil)
Sourcesplat_index
Sourceuses_block_arg?
Sourcevisibility
Sourcevisibility=(visibility : Syntax::Visibility)
Sourceyields
Source