Open
Description
We can't pass params
hash and expect keyword args to be matched because of the current IndifferentHash
implementation.
def a(a:, **); end
a(Hash[a: 1]) # => nil
a(Sinatra::IndifferentHash[a: 1]) # => ArgumentError (wrong number of arguments (given 1, expected 0; required keyword: a))
a(**Sinatra::IndifferentHash[a: 1]) # => TypeError (hash key "a" is not a Symbol)
Changing the IndifferentHash
private method convert_key
to always return key.to_s.to_sym
solves this.