Module: Laminar::Flow::OptionsValidator::InstanceMethods

Defined in:
lib/laminar/flow/options_validator.rb

Overview

Add instance methods and attributes

Instance Method Summary collapse

Instance Method Details

#validate_options(options) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/laminar/flow/options_validator.rb', line 26

def validate_options(options)
  valid = self.class.option_list
  options.each_key do |k|
    next if valid.include?(k)

    raise ArgumentError,
          "Unknown key: #{k.inspect}. Valid keys are: "\
          "#{valid.map(&:inspect).join(', ')}."
  end
end