lib/reek/smells/smell_detector.rb in reek-3.11 vs lib/reek/smells/smell_detector.rb in reek-4.0.0.pre1
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
require 'set'
require_relative 'smell_configuration'
module Reek
module Smells
@@ -29,14 +30,10 @@
def initialize(config = {})
@config = SmellConfiguration.new self.class.default_config.merge(config)
@smells_found = []
end
- def smell_category
- self.class.smell_category
- end
-
def smell_type
self.class.smell_type
end
def contexts
@@ -86,19 +83,11 @@
message: options.fetch(:message),
parameters: options.fetch(:parameters, {}))
end
class << self
- def smell_category
- @smell_category ||= default_smell_category
- end
-
def smell_type
- @smell_type ||= default_smell_category
- end
-
- def default_smell_category
- name.split(/::/)[-1]
+ @smell_type ||= name.split(/::/).last
end
def contexts
[:def, :defs]
end