Module: ForemanMaintain::CoreExt::ValidateOptions
- Defined in:
- lib/foreman_maintain/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#validate_options!(*valid_keys) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/foreman_maintain/core_ext.rb', line 4 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 |