mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Support ruby2.5 Hash#slice to Sinatra::IndifferentHash
This commit is contained in:
parent
6c1ed0b393
commit
c006e58c0a
1 changed files with 5 additions and 0 deletions
|
@ -104,6 +104,11 @@ module Sinatra
|
|||
super(*keys.map(&method(:convert_key)))
|
||||
end if method_defined?(:fetch_values) # Added in Ruby 2.3
|
||||
|
||||
def slice(*keys)
|
||||
keys.map!(&method(:convert_key))
|
||||
self.class[super(*keys)]
|
||||
end if method_defined?(:slice) # Added in Ruby 2.5
|
||||
|
||||
def values_at(*keys)
|
||||
super(*keys.map(&method(:convert_key)))
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue