Class: Packwerk::ReferenceOffense
- Defined in:
- lib/packwerk/reference_offense.rb
Overview
An offense related to a Reference.
Instance Attribute Summary collapse
-
#reference ⇒ Object
readonly
: Reference.
-
#violation_type ⇒ Object
readonly
: String.
Attributes inherited from Offense
Instance Method Summary collapse
-
#initialize(reference:, violation_type:, message:, location: nil) ⇒ ReferenceOffense
constructor
: (reference: Packwerk::Reference, violation_type: String, message: String, ?location: Node::Location?) -> void.
Methods inherited from Offense
Constructor Details
#initialize(reference:, violation_type:, message:, location: nil) ⇒ ReferenceOffense
: (reference: Packwerk::Reference, violation_type: String, message: String, ?location: Node::Location?) -> void
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)
: Reference
8 9 10 |
# File 'lib/packwerk/reference_offense.rb', line 8 def reference @reference end |
#violation_type ⇒ Object (readonly)
: String
11 12 13 |
# File 'lib/packwerk/reference_offense.rb', line 11 def violation_type @violation_type end |