Module: ForemanMaintain::CoreExt::ValidateOptions
- Defined in:
- lib/foreman_maintain/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#validate_options!(*valid_keys) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/foreman_maintain/core_ext.rb', line 16 def (*valid_keys) valid_keys.flatten! = keys - valid_keys - valid_keys.map(&:to_s) unless .empty? raise ArgumentError, "Unexpected options #{.inspect}. "\ "Valid keys are: #{valid_keys.map(&:inspect).join(', ')}" end self end |