Module: TypeResolving

Constant Summary collapse

MODELS_CLASS_NAMES =
%w[
  ApplicationRecord
  ActiveRecord::Base
].freeze
WORKERS_SUFFIXES =
%w[
  Worker
  Job
].freeze
CONTROLLER_SUFFIXES =
%w[
  Controller
].freeze
SERVICES_PATH =
File.join('app', 'services')

Instance Method Summary collapse

Instance Method Details

#on_class(node) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/ducalis/cops/extensions/type_resolving.rb', line 20

def on_class(node)
  classdef_node, superclass, _body = *node
  @node = node
  @class_name = classdef_node.loc.expression.source
  @superclass_name = superclass.loc.expression.source unless superclass.nil?
  super if defined?(super)
end

#on_module(node) ⇒ Object



28
29
30
31
# File 'lib/ducalis/cops/extensions/type_resolving.rb', line 28

def on_module(node)
  @node = node
  super if defined?(super)
end