Class: Reek::Context::SendContext
- Inherits:
-
CodeContext
- Object
- CodeContext
- Reek::Context::SendContext
- Defined in:
- lib/reek/context/send_context.rb
Overview
A context wrapper for method calls found in a syntax tree.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from CodeContext
#children, #exp, #parent, #refs, #statement_counter
Instance Method Summary collapse
-
#initialize(exp, name) ⇒ SendContext
constructor
A new instance of SendContext.
- #method_name_called_to_call ⇒ Object
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
#name ⇒ Object (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_call ⇒ Object
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 |