Class: OptionsChecker
- Inherits:
-
Object
- Object
- OptionsChecker
- Defined in:
- lib/options_checker.rb
Overview
module OptionsChecker
VERSION = '0.0.1'
end
Class Method Summary collapse
Class Method Details
.check(options, mandatories) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/options_checker.rb', line 9 def self.check , mandatories raise "options argument must be a Hash" unless .is_a?(Hash) raise "mandatories argument must be an Array" unless mandatories.is_a?(Array) for mandatory in mandatories raise "Argument #{mandatory} cannot be nil. You provided: #{.inspect}" if [mandatory].nil? end return end |