Class: Packwerk::ReferenceOffense
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/packwerk/reference_offense.rb
Overview
An offense related to a Reference.
Instance Attribute Summary collapse
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#violation_type ⇒ Object
readonly
Returns the value of attribute violation_type.
Attributes inherited from Offense
Instance Method Summary collapse
-
#initialize(reference:, violation_type:, message:, location: nil) ⇒ ReferenceOffense
constructor
A new instance of ReferenceOffense.
Methods inherited from Offense
Constructor Details
#initialize(reference:, violation_type:, message:, location: nil) ⇒ ReferenceOffense
Returns a new instance of ReferenceOffense.
25 26 27 28 29 |
# File 'lib/packwerk/reference_offense.rb', line 25 def initialize(reference:, violation_type:, message:, location: nil) super(file: T.must(reference.relative_path), message: , location: location) @reference = reference @violation_type = violation_type end |
Instance Attribute Details
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
11 12 13 |
# File 'lib/packwerk/reference_offense.rb', line 11 def reference @reference end |
#violation_type ⇒ Object (readonly)
Returns the value of attribute violation_type.
14 15 16 |
# File 'lib/packwerk/reference_offense.rb', line 14 def violation_type @violation_type end |