Class: Homebrew::Style::Offense Private

Inherits:
Object
  • Object
show all
Defined in:
brew/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

Instance Method Summary collapse

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.



252
253
254
255
256
257
258
# File 'brew/Library/Homebrew/style.rb', line 252

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_nameObject (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.



250
251
252
# File 'brew/Library/Homebrew/style.rb', line 250

def cop_name
  @cop_name
end

#correctedObject (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.



250
251
252
# File 'brew/Library/Homebrew/style.rb', line 250

def corrected
  @corrected
end

#locationObject (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.



250
251
252
# File 'brew/Library/Homebrew/style.rb', line 250

def location
  @location
end

#messageObject (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.



250
251
252
# File 'brew/Library/Homebrew/style.rb', line 250

def message
  @message
end

#severityObject (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.



250
251
252
# File 'brew/Library/Homebrew/style.rb', line 250

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.

Returns:

  • (Boolean)


264
265
266
# File 'brew/Library/Homebrew/style.rb', line 264

def corrected?
  @corrected
end

#severity_codeObject

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.



260
261
262
# File 'brew/Library/Homebrew/style.rb', line 260

def severity_code
  @severity[0].upcase
end