Module: ClockworkComicPDF::OptionValidation
- Defined in:
- lib/clockwork_comic_pdf/option_validation.rb
Overview
provides option validation and requirements vaildaiton
Instance Method Summary collapse
Instance Method Details
#check_options(options, valid_options) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/clockwork_comic_pdf/option_validation.rb', line 7 def (, ) .each do |key| unless .include? key fail UndefinedKeyError, "Unsupported key '#{key}' " << "for '#{self.class}'" end end end |
#check_required(options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/clockwork_comic_pdf/option_validation.rb', line 16 def check_required( = {}) .each_pair do |key, val| fail UndefinedKeyError, "'#{self.class}' requires " << "key '#{key}'" if val.nil? end end |