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
Returns a new instance of Error.
13 14 15 16 17 18 19 20 |
# File 'lib/valigator/csv/error.rb', line 13 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.
11 12 13 |
# File 'lib/valigator/csv/error.rb', line 11 def details @details end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
11 12 13 |
# File 'lib/valigator/csv/error.rb', line 11 def field @field end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/valigator/csv/error.rb', line 11 def @message end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
11 12 13 |
# File 'lib/valigator/csv/error.rb', line 11 def row @row end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/valigator/csv/error.rb', line 11 def type @type end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 |
# File 'lib/valigator/csv/error.rb', line 22 def ==(other) row == other.row && == other. && type == other.type && field == other.field && details == other.details end |
#to_hash ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/valigator/csv/error.rb', line 26 def to_hash { row: row, type: type, message: , field: field, details: details } end |