Class: Halunke::MessageSendNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/halunke/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodesObject

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



133
134
135
# File 'lib/halunke/nodes.rb', line 133

def nodes
  @nodes
end

#teObject

Returns the value of attribute te

Returns:

  • (Object)

    the current value of te



133
134
135
# File 'lib/halunke/nodes.rb', line 133

def te
  @te
end

#tsObject

Returns the value of attribute ts

Returns:

  • (Object)

    the current value of ts



133
134
135
# File 'lib/halunke/nodes.rb', line 133

def ts
  @ts
end

Instance Method Details

#==(other) ⇒ Object



140
141
142
143
# File 'lib/halunke/nodes.rb', line 140

def ==(other)
  other.is_a?(MessageSendNode) &&
    nodes == other.nodes
end

#eval(context) ⇒ Object



134
135
136
137
138
# File 'lib/halunke/nodes.rb', line 134

def eval(context)
  message_name, message_value = parse_message(context)
  receiver.eval(context).receive_message(context, message_name, message_value,
                                         source_code_position: source_code_position)
end

#source_code_positionObject



145
146
147
# File 'lib/halunke/nodes.rb', line 145

def source_code_position
  SourceCodePosition.new(ts, te)
end