Class: Melbourne::AST::Send

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

Overview

A method invocation (a message being sent) as in:

method()

Direct Known Subclasses

SendWithArguments

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, privately = false) ⇒ Send

Returns a new instance of Send.



29
30
31
32
33
34
35
36
# File 'lib/melbourne/ast/sends.rb', line 29

def initialize(line, receiver, name, privately=false)
  @line = line
  @receiver = receiver
  @name = name
  @privately = privately
  @block = nil
  @check_for_local = false
end

Instance Attribute Details

#blockObject

The block that is passed to the invocation if one is passed



23
24
25
# File 'lib/melbourne/ast/sends.rb', line 23

def block
  @block
end

#check_for_localObject

Returns the value of attribute check_for_local.



27
28
29
# File 'lib/melbourne/ast/sends.rb', line 27

def check_for_local
  @check_for_local
end

#nameObject

The message being sent/ method being invoked



17
18
19
# File 'lib/melbourne/ast/sends.rb', line 17

def name
  @name
end

#privatelyObject

Returns the value of attribute privately.



19
20
21
# File 'lib/melbourne/ast/sends.rb', line 19

def privately
  @privately
end

#receiverObject

The receiver of the message/ invocation



13
14
15
# File 'lib/melbourne/ast/sends.rb', line 13

def receiver
  @receiver
end

#variableObject

Returns the value of attribute variable.



25
26
27
# File 'lib/melbourne/ast/sends.rb', line 25

def variable
  @variable
end