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:



659
660
661
662
663
664
665
666
667
# File 'style.rb', line 659

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")
  source_location = SourceLocation.new(location.fetch("line"), location["column"])
  @location = T.let(source_location, SourceLocation)
end

Instance Attribute Details

#cop_name ⇒ String? (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:



650
651
652
# File 'style.rb', line 650

def cop_name
  @cop_name
end

#corrected ⇒ Boolean (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)


653
654
655
# File 'style.rb', line 653

def corrected
  @corrected
end

#location ⇒ SourceLocation (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:



656
657
658
# File 'style.rb', line 656

def location
  @location
end

#message ⇒ String (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:



647
648
649
# File 'style.rb', line 647

def message
  @message
end

#severity ⇒ String? (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:



650
651
652
# File 'style.rb', line 650

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)


670
671
672
# File 'style.rb', line 670

def corrected?
  @corrected
end