def assert_exclusive_keys(hash, *exclusive_keys)
      conflicting_keys = exclusive_keys & hash.keys
      raise ArgumentError, "Conflicting keys: #{conflicting_keys.join(', ')}" unless conflicting_keys.length <= 1
    end
def assert_exclusive_keys(hash, *exclusive_keys)
      conflicting_keys = exclusive_keys & hash.keys
      raise ArgumentError, "Conflicting keys: #{conflicting_keys.join(', ')}" unless conflicting_keys.length <= 1
    end
Validates that the given hash only includes at *most* one of a set of
 exclusive keys.  If more than one key is found, an ArgumentError will be
 raised.

 == Examples

   options = {:only => :on, :except => :off}
   assert_exclusive_keys(options, :only)                   # => nil
   assert_exclusive_keys(options, :except)                 # => nil
   assert_exclusive_keys(options, :only, :except)          # => ArgumentError: Conflicting keys: only, except
   assert_exclusive_keys(options, :only, :except, :with)   # => ArgumentError: Conflicting keys: only, except