Class: Valigator::CSV::Error
- Inherits:
-
Object
- Object
- Valigator::CSV::Error
- Defined in:
- lib/valigator/csv/error.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(error) ⇒ Error
constructor
A new instance of Error.
- #to_hash ⇒ Object
Constructor Details
#initialize(error) ⇒ Error
17 18 19 20 21 22 23 24 |
# File 'lib/valigator/csv/error.rb', line 17 def initialize(error) case error when Hash build_from_hash error when StandardError build_from_error error end end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
13 14 15 |
# File 'lib/valigator/csv/error.rb', line 13 def details @details end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
13 14 15 |
# File 'lib/valigator/csv/error.rb', line 13 def field @field end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/valigator/csv/error.rb', line 13 def end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
13 14 15 |
# File 'lib/valigator/csv/error.rb', line 13 def row @row end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/valigator/csv/error.rb', line 13 def type @type end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 |
# File 'lib/valigator/csv/error.rb', line 28 def ==(other) row == other.row && == other. && type == other.type && field == other.field && details == other.details end |
#to_hash ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/valigator/csv/error.rb', line 34 def to_hash { row: row, type: type, message: , field: field, details: details } end |