Class: Reek::ModuleContext
Instance Attribute Summary
Attributes inherited from CodeContext
#name
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from CodeContext
#matches?, #method_missing, #num_methods, #to_s
Constructor Details
#initialize(outer, name) ⇒ ModuleContext
Returns a new instance of ModuleContext.
11
12
13
14
|
# File 'lib/reek/module_context.rb', line 11
def initialize(outer, name)
super(outer, nil)
@name = name
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Reek::CodeContext
Instance Method Details
#find_module(modname) ⇒ Object
20
21
22
23
|
# File 'lib/reek/module_context.rb', line 20
def find_module(modname)
return nil unless myself
@myself.const_or_nil(modname.to_s)
end
|
16
17
18
|
# File 'lib/reek/module_context.rb', line 16
def myself
@myself ||= @outer.find_module(@name)
end
|
#outer_name ⇒ Object
25
26
27
|
# File 'lib/reek/module_context.rb', line 25
def outer_name
"#{@outer.outer_name}#{@name}::"
end
|
#variable_names ⇒ Object
29
30
31
|
# File 'lib/reek/module_context.rb', line 29
def variable_names
[]
end
|