Class: Reek::StopContext

Inherits:
Object show all
Defined in:
lib/reek/stop_context.rb

Instance Method Summary collapse

Constructor Details

#initializeStopContext

Returns a new instance of StopContext.



4
5
6
7
# File 'lib/reek/stop_context.rb', line 4

def initialize
  @refs = ObjectRefs.new
  @myself = Object
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



8
9
10
# File 'lib/reek/stop_context.rb', line 8

def method_missing(method, *args)
  nil
end

Instance Method Details

#count_statements(num) ⇒ Object



13
14
15
# File 'lib/reek/stop_context.rb', line 13

def count_statements(num)
  0
end

#find_module(name) ⇒ Object



17
18
19
20
# File 'lib/reek/stop_context.rb', line 17

def find_module(name)
  sym = name.to_s
  @myself.const_defined?(sym) ? @myself.const_get(sym) : nil
end

#has_parameter(sym) ⇒ Object



22
23
24
# File 'lib/reek/stop_context.rb', line 22

def has_parameter(sym)
  false
end

#inside_a_block?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/reek/stop_context.rb', line 26

def inside_a_block?
  false
end

#is_overriding_method?(name) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/reek/stop_context.rb', line 30

def is_overriding_method?(name)
  false
end

#num_statementsObject



34
35
36
# File 'lib/reek/stop_context.rb', line 34

def num_statements
  0
end

#outer_nameObject



46
47
48
# File 'lib/reek/stop_context.rb', line 46

def outer_name
  ''
end

#record_depends_on_selfObject



42
43
44
# File 'lib/reek/stop_context.rb', line 42

def record_depends_on_self
  false
end

#refsObject



38
39
40
# File 'lib/reek/stop_context.rb', line 38

def refs
  @refs
end