Class: Melbourne::AST::DefineSingleton

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/definitions.rb

Overview

A singleton method definition as in:

def object.method
end

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, receiver, name, block) ⇒ DefineSingleton

Returns a new instance of DefineSingleton.



129
130
131
132
133
# File 'lib/melbourne/ast/definitions.rb', line 129

def initialize(line, receiver, name, block)
  @line = line
  @receiver = receiver
  @body = DefineSingletonScope.new line, name, block
end

Instance Attribute Details

#bodyObject

The body of the defined method



127
128
129
# File 'lib/melbourne/ast/definitions.rb', line 127

def body
  @body
end

#nameObject

The receiver of the definition



123
124
125
# File 'lib/melbourne/ast/definitions.rb', line 123

def name
  @name
end