Exception: CSVUtils::HeaderNotFoundError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- CSVUtils::HeaderNotFoundError
- Includes:
- Error
- Defined in:
- lib/csv_utils/header_not_found_error.rb
Overview
Raised when a header the caller named isn't in the file. A RuntimeError, as before this class existed.
Instance Attribute Summary collapse
-
#header ⇒ String
readonly
The header that wasn't found.
-
#headers ⇒ Array<String>
readonly
The headers of the file.
Instance Method Summary collapse
-
#initialize(header, headers) ⇒ HeaderNotFoundError
constructor
A new instance of HeaderNotFoundError.
Constructor Details
#initialize(header, headers) ⇒ HeaderNotFoundError
Returns a new instance of HeaderNotFoundError.
15 16 17 18 19 |
# File 'lib/csv_utils/header_not_found_error.rb', line 15 def initialize(header, headers) @header = header @headers = headers super("header #{header} not found in #{headers}") end |
Instance Attribute Details
#header ⇒ String (readonly)
Returns the header that wasn't found.
9 10 11 |
# File 'lib/csv_utils/header_not_found_error.rb', line 9 def header @header end |
#headers ⇒ Array<String> (readonly)
Returns the headers of the file.
11 12 13 |
# File 'lib/csv_utils/header_not_found_error.rb', line 11 def headers @headers end |