Class: Packwerk::ReferenceOffense
- Defined in:
- lib/packwerk/reference_offense.rb
Overview
An offense related to a Reference.
Instance Attribute Summary collapse
- #reference ⇒ Object readonly
- #violation_type ⇒ Object readonly
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.
14 15 16 17 18 19 |
# File 'lib/packwerk/reference_offense.rb', line 14 def initialize(reference:, violation_type:, message:, location: nil) file = reference.relative_path #: as !nil super(file: file, message: , location: location) @reference = reference @violation_type = violation_type end |
Instance Attribute Details
#reference ⇒ Object (readonly)
8 9 10 |
# File 'lib/packwerk/reference_offense.rb', line 8 def reference @reference end |
#violation_type ⇒ Object (readonly)
11 12 13 |
# File 'lib/packwerk/reference_offense.rb', line 11 def violation_type @violation_type end |