Class: Commissar::Finding
- Inherits:
-
Struct
- Object
- Struct
- Commissar::Finding
- Defined in:
- lib/commissar.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#message ⇒ Object
Returns the value of attribute message.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#snippet ⇒ Object
Returns the value of attribute snippet.
Instance Method Summary collapse
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category
76 77 78 |
# File 'lib/commissar.rb', line 76 def category @category end |
#file ⇒ Object
Returns the value of attribute file
76 77 78 |
# File 'lib/commissar.rb', line 76 def file @file end |
#line ⇒ Object
Returns the value of attribute line
76 77 78 |
# File 'lib/commissar.rb', line 76 def line @line end |
#message ⇒ Object
Returns the value of attribute message
76 77 78 |
# File 'lib/commissar.rb', line 76 def @message end |
#severity ⇒ Object
Returns the value of attribute severity
76 77 78 |
# File 'lib/commissar.rb', line 76 def severity @severity end |
#snippet ⇒ Object
Returns the value of attribute snippet
76 77 78 |
# File 'lib/commissar.rb', line 76 def snippet @snippet end |
Instance Method Details
#to_s ⇒ Object
81 82 83 84 85 |
# File 'lib/commissar.rb', line 81 def to_s loc = [file, line].compact.join(":") loc_str = loc.empty? ? "" : " => #{loc}" "[#{severity.ljust(4)}] #{}#{loc_str}" end |
#weight ⇒ Object
77 78 79 |
# File 'lib/commissar.rb', line 77 def weight SEVERITY_WEIGHT.fetch(severity, 0) end |