Exception: SpreadsheetArchitect::Exceptions::InvalidRangeError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/spreadsheet_architect/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, range) ⇒ InvalidRangeError

Returns a new instance of InvalidRangeError.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/spreadsheet_architect/exceptions.rb', line 17

def initialize(type, range)
  case type
  when :columns, :rows
    super("Invalid range `#{range}` passed. Some of the #{type} specified were greater than the total number of #{type}")
  when :format
    super("Invalid range `#{range}` passed. Format must be as follows: A1:D4")
  when :type
    super("Invalid range type `#{range}`. Valid types are String and Hash")
  else
    super("Invalid range `#{range}` passed.")
  end
end