Class: RuboCop::Cop::Kata::AgentNoun

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/kata/agent_noun.rb

Constant Summary collapse

MSG =
"`%s` names a doer; name the class for the thing it is, not the work it does."
HINT =
"#{MSG} Try `%s`.".freeze
SUFFIX =
/(?:er|or)\z/
SEGMENT =
/[A-Z]+(?=[A-Z][a-z]|\z)|[A-Z][a-z0-9]*/
DERIVATIONS =
[[/ator\z/, "ation"], [/ector\z/, "ection"], [/isor\z/, "ision"], [/i[zs]er\z/, "is"]].freeze

Instance Method Summary collapse

Instance Method Details

#on_class(node) ⇒ Object



10
# File 'lib/rubocop/cop/kata/agent_noun.rb', line 10

def on_class(node) = check(node)

#on_module(node) ⇒ Object



12
# File 'lib/rubocop/cop/kata/agent_noun.rb', line 12

def on_module(node) = check(node)