Class: LcpRuby::I18nCheck::Offense
- Inherits:
-
Struct
- Object
- Struct
- LcpRuby::I18nCheck::Offense
- Defined in:
- lib/lcp_ruby/i18n_check/offense.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#file ⇒ Object
Returns the value of attribute file.
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#line ⇒ Object
Returns the value of attribute line.
-
#method ⇒ Object
Returns the value of attribute method.
-
#missing_in ⇒ Object
Returns the value of attribute missing_in.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#suggested_fix ⇒ Object
Returns the value of attribute suggested_fix.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def content @content end |
#file ⇒ Object
Returns the value of attribute file
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def file @file end |
#keys ⇒ Object
Returns the value of attribute keys
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def keys @keys end |
#kind ⇒ Object
Returns the value of attribute kind
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def kind @kind end |
#line ⇒ Object
Returns the value of attribute line
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def line @line end |
#method ⇒ Object
Returns the value of attribute method
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def method @method end |
#missing_in ⇒ Object
Returns the value of attribute missing_in
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def missing_in @missing_in end |
#severity ⇒ Object
Returns the value of attribute severity
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def severity @severity end |
#suggested_fix ⇒ Object
Returns the value of attribute suggested_fix
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def suggested_fix @suggested_fix end |
#value ⇒ Object
Returns the value of attribute value
3 4 5 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 3 def value @value end |
Instance Method Details
#error? ⇒ Boolean
9 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 9 def error?; severity == :error; end |
#info? ⇒ Boolean
11 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 11 def info?; severity == :info; end |
#to_h_v1 ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 13 def to_h_v1 { file: file, line: line, kind: kind&.to_s, severity: severity&.to_s, method: method&.to_s, content: content, value: value, suggested_fix: suggested_fix, keys: keys, missing_in: Array(missing_in).map(&:to_s) } end |
#warning? ⇒ Boolean
10 |
# File 'lib/lcp_ruby/i18n_check/offense.rb', line 10 def warning?; severity == :warning; end |