lib/option_initializer.rb in option_initializer-1.1.3 vs lib/option_initializer.rb in option_initializer-1.1.4
- old
+ new
@@ -1,8 +1,11 @@
require "option_initializer/version"
module OptionInitializer
def validate_options options
+ raise TypeError,
+ "wrong argument type #{options.class} (expected Hash)" unless
+ options.is_a?(Hash)
return if options.respond_to?(:option_validated?)
validators = self.class.const_get(:OptionInitializing).const_get(:VALIDATORS)
validators.each do |validator|
options.each do |k, v|
validator.call k, v