Class: Class

Inherits:
Object show all
Defined in:
lib/reek/class_context.rb,
lib/reek/smells/smell_detector.rb

Instance Method Summary collapse

Instance Method Details

#is_overriding_method?(name) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/reek/class_context.rb', line 5

def is_overriding_method?(name)
  sym = name.to_sym
  mine = instance_methods(false)
  dads = superclass.instance_methods(true)
  (mine.include?(sym) and dads.include?(sym)) or (mine.include?(name) and dads.include?(name))
end

#name_wordsObject



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

def name_words
  class_name = name.split(/::/)[-1]
  class_name.gsub(/([a-z])([A-Z])/) { |sub| "#{$1} #{$2}"}.split
end