class

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)
Source

Instance methods

==(other : self)

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

abstract=(abstract __arg0 : Bool)
Source
abstract?
Source
accept_children(visitor)
Source
args
Source
args=(args : Array(Arg))
Source
assigns_special_var=(assigns_special_var : Bool)
Source
assigns_special_var?
Source
block_arg
Source
block_arg=(block_arg : Arg | Nil)
Source
body
Source
body=(body : ASTNode)
Source
calls_initialize=(calls_initialize : Bool)
Source
calls_initialize?
Source
calls_previous_def=(calls_previous_def : Bool)
Source
calls_previous_def?
Source
calls_super=(calls_super : Bool)
Source
calls_super?
Source
clone_without_location
Source
doc

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

Source
doc=(doc : String | Nil)
Source
double_splat
Source
double_splat=(double_splat : Arg | Nil)
Source
free_vars
Source
free_vars=(free_vars : Array(String) | Nil)
Source
hash(hasher)

See Object#hash(hasher)

macro_def=(macro_def : Bool)
Source
macro_def?
Source
name
Source
name=(name : String)
Source
name_location
Source
name_location=(name_location : Location | Nil)
Source
name_size
Source
receiver
Source
receiver=(receiver : ASTNode | Nil)
Source
return_type
Source
return_type=(return_type : ASTNode | Nil)
Source
splat_index
Source
splat_index=(splat_index : Int32 | Nil)
Source
uses_block_arg=(uses_block_arg : Bool)
Source
uses_block_arg?
Source
visibility
Source
visibility=(visibility : Syntax::Visibility)
Source
yields
Source
yields=(yields : Int32 | Nil)
Source