Class: RuboCop::Cop::Severity
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Comparable
|
|
Inherits: | Object |
Defined in: | lib/rubocop/cop/severity.rb |
Overview
Severity class is simple value object about severity
Constant Summary
-
CODE_TABLE =
Internal use only
# File 'lib/rubocop/cop/severity.rb', line 12{ I: :info, R: :refactor, C: :convention, W: :warning, E: :error, F: :fatal }.freeze
-
NAMES =
# File 'lib/rubocop/cop/severity.rb', line 9%i[info refactor convention warning error fatal].freeze
Class Method Summary
- .name_from_code(code)
- .new(name_or_code) ⇒ Severity constructor Internal use only Internal use only
Instance Attribute Summary
- #name ⇒ Symbol readonly
Instance Method Summary
Class Method Details
.name_from_code(code)
[ GitHub ]Instance Attribute Details
#name ⇒ Symbol
(readonly)
# File 'lib/rubocop/cop/severity.rb', line 22
attr_reader :name
Instance Method Details
#<=>(other)
[ GitHub ]#==(other)
[ GitHub ]# File 'lib/rubocop/cop/severity.rb', line 50
def ==(other) @name == if other.is_a?(Symbol) other else other.name end end
#code
[ GitHub ]# File 'lib/rubocop/cop/severity.rb', line 42
def code @name.to_s[0].upcase end
#hash
[ GitHub ]# File 'lib/rubocop/cop/severity.rb', line 58
def hash @name.hash end
#level
[ GitHub ]#to_s
[ GitHub ]# File 'lib/rubocop/cop/severity.rb', line 38
def to_s @name.to_s end