Class: LiquidXlsx::Validation::Issue
- Inherits:
-
Struct
- Object
- Struct
- LiquidXlsx::Validation::Issue
- Defined in:
- lib/liquid_xlsx/validation/issue.rb
Overview
A single problem found in a template.
code is a stable machine-readable symbol: host applications map it to
their own localized text, so the English message here is a fallback for
logs and specs, never the only thing a user can be shown.
Instance Attribute Summary collapse
-
#cell ⇒ Object
Returns the value of attribute cell.
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
-
#row ⇒ Object
Returns the value of attribute row.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#sheet ⇒ Object
Returns the value of attribute sheet.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#location ⇒ Object
Human-readable location: "Sheet1!B12", "Sheet1 row 12" or "Sheet1".
- #to_h ⇒ Object
- #warning? ⇒ Boolean
Instance Attribute Details
#cell ⇒ Object
Returns the value of attribute cell
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def cell @cell end |
#code ⇒ Object
Returns the value of attribute code
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def code @code end |
#message ⇒ Object
Returns the value of attribute message
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def @message end |
#row ⇒ Object
Returns the value of attribute row
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def row @row end |
#severity ⇒ Object
Returns the value of attribute severity
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def severity @severity end |
#sheet ⇒ Object
Returns the value of attribute sheet
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def sheet @sheet end |
#source ⇒ Object
Returns the value of attribute source
10 11 12 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 10 def source @source end |
Instance Method Details
#error? ⇒ Boolean
12 13 14 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 12 def error? severity == :error end |
#location ⇒ Object
Human-readable location: "Sheet1!B12", "Sheet1 row 12" or "Sheet1".
21 22 23 24 25 26 27 28 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 21 def location return nil unless sheet return "#{sheet}!#{cell}" if cell return "#{sheet} row #{row}" if row sheet end |
#to_h ⇒ Object
30 31 32 33 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 30 def to_h { code: code, severity: severity, sheet: sheet, row: row, cell: cell, message: , source: source } end |
#warning? ⇒ Boolean
16 17 18 |
# File 'lib/liquid_xlsx/validation/issue.rb', line 16 def warning? severity == :warning end |