Exception: Tabledata::InvalidOptions

Inherits:
ArgumentError
  • Object
show all
Includes:
Exception
Defined in:
lib/tabledata/exceptions.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_name, invalid_keys) ⇒ InvalidOptions


18
19
20
# File 'lib/tabledata/exceptions.rb', line 18

def initialize(method_name, invalid_keys)
  super("Invalid options for method #{method_name}: #{invalid_keys.inspect[1..-2]}")
end

Class Method Details

.verify!(method_name, options, valid_keys) ⇒ Object


13
14
15
16
# File 'lib/tabledata/exceptions.rb', line 13

def self.verify!(method_name, options, valid_keys)
  invalid_keys = options.keys-valid_keys
  raise new(method_name, invalid_keys) unless invalid_keys.empty?
end