mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-11-27 00:03:06 -05:00
TIL Hash#select is different in 1.8
This commit is contained in:
parent
b819e5de37
commit
ff5be97ada
@ -13,7 +13,16 @@ module Stripe
|
||||
# Assume all remaining opts must be headers
|
||||
|
||||
response, opts[:api_key] = Stripe.request(method, url, api_key, params, headers, api_base)
|
||||
[response, opts.select {|k, _| @@opts_to_persist.include?(k)}]
|
||||
|
||||
# Hash#select returns an array before 1.9
|
||||
opts_to_persist = {}
|
||||
opts.each do |k, v|
|
||||
if @@opts_to_persist.include?(k)
|
||||
opts_to_persist[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
[response, opts_to_persist]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user