Exception: CSVUtils::UnsortedFileError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- CSVUtils::UnsortedFileError
- Includes:
- Error
- Defined in:
- lib/csv_utils/unsorted_file_error.rb
Overview
Raised by CSVCompare when a file isn't sorted the way its compare block expects.
Instance Attribute Summary collapse
-
#file ⇒ String
readonly
Path of the file.
-
#lineno ⇒ Integer
readonly
Physical line of the first record out of order.
Instance Method Summary collapse
-
#initialize(file, lineno) ⇒ UnsortedFileError
constructor
A new instance of UnsortedFileError.
Constructor Details
#initialize(file, lineno) ⇒ UnsortedFileError
Returns a new instance of UnsortedFileError.
15 16 17 18 19 |
# File 'lib/csv_utils/unsorted_file_error.rb', line 15 def initialize(file, lineno) @file = file @lineno = lineno super("#{file} isn't sorted: the record on line #{lineno} sorts before the one above it") end |
Instance Attribute Details
#file ⇒ String (readonly)
Returns path of the file.
9 10 11 |
# File 'lib/csv_utils/unsorted_file_error.rb', line 9 def file @file end |
#lineno ⇒ Integer (readonly)
Returns physical line of the first record out of order.
11 12 13 |
# File 'lib/csv_utils/unsorted_file_error.rb', line 11 def lineno @lineno end |