Exception: SpreadsheetArchitect::Exceptions::InvalidRangeError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- ArgumentError
- SpreadsheetArchitect::Exceptions::InvalidRangeError
- Defined in:
- lib/spreadsheet_architect/exceptions.rb
Instance Method Summary collapse
-
#initialize(type, range, message: nil) ⇒ InvalidRangeError
constructor
A new instance of InvalidRangeError.
Constructor Details
#initialize(type, range, message: nil) ⇒ InvalidRangeError
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/spreadsheet_architect/exceptions.rb', line 17 def initialize(type, range, message: nil) default_msg = "Invalid range `#{range}` passed" if .nil? case type when :missing_range_keys = "Missing :rows or :columns key" when :format = "Format must be as follows: A1:D4" when :type = "Valid types are Hash and String" end end super([default_msg, ].compact.join(". ")) end |