Class: Homebrew::Style::Offense Private

Inherits:
Object
  • Object
show all
Defined in:
style.rb

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

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ void

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.

Parameters:



576
577
578
579
580
581
582
583
# File 'style.rb', line 576

def initialize(json)
  @severity = T.let(json["severity"], T.nilable(String))
  @message = T.let(json.fetch("message"), String)
  @cop_name = T.let(json["cop_name"], T.nilable(String))
  @corrected = T.let(json["corrected"], T::Boolean)
  location = json.fetch("location")
  @location = T.let(SourceLocation.new(location.fetch("line"), location["column"]), SourceLocation)
end

Instance Attribute Details

#cop_nameString? (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.

Returns:



567
568
569
# File 'style.rb', line 567

def cop_name
  @cop_name
end

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

Returns:

  • (Boolean)


570
571
572
# File 'style.rb', line 570

def corrected
  @corrected
end

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

Returns:



573
574
575
# File 'style.rb', line 573

def location
  @location
end

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

Returns:



564
565
566
# File 'style.rb', line 564

def message
  @message
end

#severityString? (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.

Returns:



567
568
569
# File 'style.rb', line 567

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.

Returns:

  • (Boolean)


586
587
588
# File 'style.rb', line 586

def corrected?
  @corrected
end