sinatra-param icon indicating copy to clipboard operation
sinatra-param copied to clipboard

Fix parameter coerce when Hash or Array expected.

Open serargz opened this issue 10 years ago • 2 comments

When Array is expected and for some reason a Hash is received, an unhandled exception was raised. The same thing happens when Hash is expected an Array is received. This commit converts the Hash to Array with Array#to_a for the first case, and converts the Array to string for the former.

serargz avatar Jun 15 '15 15:06 serargz

hi @mattt, any plans to merge this PR?

serargz avatar Jun 17 '15 22:06 serargz

Apologies for the delay in responding, @serargz. Thank you for your contribution.

I think there's a lot of room for improvement in the current implementation. The clever Ruby idioms I used in the initial implementation aren't looking too great now with all of this additional functionality. I'm investigating a refactoring for all this in the next major release, and will look into how best to incorporate your changes.

mattt avatar Mar 20 '18 16:03 mattt