Class: Homebrew::Style::Offense Private
- Inherits:
-
Object
- Object
- Homebrew::Style::Offense
- Defined in:
- Library/Homebrew/style.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
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. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Offense.
253 254 255 256 257 258 259 |
# File 'Library/Homebrew/style.rb', line 253 def initialize(json) @severity = json["severity"] @message = json["message"] @cop_name = json["cop_name"] @corrected = json["corrected"] @location = LineLocation.new(json["location"]) end |
Instance Attribute Details
#cop_name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
251 252 253 |
# File 'Library/Homebrew/style.rb', line 251 def cop_name @cop_name end |
#corrected ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
251 252 253 |
# File 'Library/Homebrew/style.rb', line 251 def corrected @corrected end |
#location ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
251 252 253 |
# File 'Library/Homebrew/style.rb', line 251 def location @location end |
#message ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
251 252 253 |
# File 'Library/Homebrew/style.rb', line 251 def @message end |
#severity ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
251 252 253 |
# File 'Library/Homebrew/style.rb', line 251 def severity @severity end |
Instance Method Details
#corrected? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
265 266 267 |
# File 'Library/Homebrew/style.rb', line 265 def corrected? @corrected end |
#severity_code ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
261 262 263 |
# File 'Library/Homebrew/style.rb', line 261 def severity_code @severity[0].upcase end |