Class: Homebrew::Style::Offense Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A style offense.
Instance Attribute Summary collapse
- #cop_name ⇒ Object readonly private
- #corrected ⇒ Object readonly private
- #location ⇒ Object readonly private
- #message ⇒ Object readonly private
- #severity ⇒ Object readonly private
Instance Method Summary collapse
- #corrected? ⇒ Boolean private
-
#initialize(json) ⇒ Offense
constructor
private
A new instance of Offense.
- #severity_code ⇒ Object private
Constructor Details
#initialize(json) ⇒ Offense
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of Offense.
376 377 378 379 380 381 382 383 |
# File 'style.rb', line 376 def initialize(json) @severity = json["severity"] @message = json["message"] @cop_name = json["cop_name"] @corrected = json["corrected"] location = json["location"] @location = SourceLocation.new(location.fetch("line"), location["column"]) end |
Instance Attribute Details
#cop_name ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
374 375 376 |
# File 'style.rb', line 374 def cop_name @cop_name end |
#corrected ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
374 375 376 |
# File 'style.rb', line 374 def corrected @corrected end |
#location ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
374 375 376 |
# File 'style.rb', line 374 def location @location end |
#message ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
374 375 376 |
# File 'style.rb', line 374 def @message end |
#severity ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
374 375 376 |
# File 'style.rb', line 374 def severity @severity end |
Instance Method Details
#corrected? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
389 390 391 |
# File 'style.rb', line 389 def corrected? @corrected end |
#severity_code ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
385 386 387 |
# File 'style.rb', line 385 def severity_code @severity[0].upcase end |