Class: ArchSpec::Rules::Naming::Forbidden
- Inherits:
-
Object
- Object
- ArchSpec::Rules::Naming::Forbidden
- Defined in:
- lib/archspec/rules/naming_rules.rb
Overview
Forbids any selected method from existing. Rule id naming.forbidden.
Instance Method Summary collapse
- #diagnostics(selected, rule, _graph) ⇒ Object
- #id ⇒ Object
-
#initialize(because: nil) ⇒ Forbidden
constructor
A new instance of Forbidden.
Constructor Details
#initialize(because: nil) ⇒ Forbidden
Returns a new instance of Forbidden.
77 78 79 |
# File 'lib/archspec/rules/naming_rules.rb', line 77 def initialize(because: nil) @because = because end |
Instance Method Details
#diagnostics(selected, rule, _graph) ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/archspec/rules/naming_rules.rb', line 85 def diagnostics(selected, rule, _graph) selected.map do |definition, _match| Diagnostic.new( rule: id, message: (definition), location: definition.location, evidence: "#{definition.owner} defines #{definition.scope} method #{definition.name} (#{rule.selector.describe})" ) end end |
#id ⇒ Object
81 82 83 |
# File 'lib/archspec/rules/naming_rules.rb', line 81 def id 'naming.forbidden' end |