Class: Reek::Context::SendContext

Inherits:
CodeContext show all
Defined in:
lib/reek/context/send_context.rb

Overview

A context wrapper for method calls found in a syntax tree.

Instance Attribute Summary collapse

Attributes inherited from CodeContext

#children, #exp, #parent, #refs, #statement_counter

Instance Method Summary collapse

Methods inherited from CodeContext

#append_child_context, #apply_current_visibility, #config_for, #configuration_via_code_commment, #each, #full_comment, #full_name, #instance_method?, #local_nodes, #matches?, #number_of_statements, #parent_config_for, #record_call_to, #record_use_of_self, #register_with_parent, #singleton_method?

Constructor Details

#initialize(exp, name) ⇒ SendContext

Returns a new instance of SendContext.



13
14
15
16
# File 'lib/reek/context/send_context.rb', line 13

def initialize(exp, name)
  @name = name
  super(exp)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/reek/context/send_context.rb', line 11

def name
  @name
end

Instance Method Details

#method_name_called_to_callObject



18
19
20
21
22
# File 'lib/reek/context/send_context.rb', line 18

def method_name_called_to_call
  return unless @name == :method

  local_nodes(:sym).map(&:name)
end