mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-08-24 00:00:51 -04:00
Fix comment and use two argument form of Hash#fetch
This commit is contained in:
parent
da6736478e
commit
66be9d48dd
@ -35,8 +35,8 @@ module Stripe
|
||||
when Array
|
||||
resp.map { |i| convert_to_stripe_object(i, api_key) }
|
||||
when Hash
|
||||
# Try converting to a known object class. If none available, fall back to generic APIResource
|
||||
object_classes.fetch(resp[:object]) { StripeObject }.construct_from(resp, api_key)
|
||||
# Try converting to a known object class. If none available, fall back to generic StripeObject
|
||||
object_classes.fetch(resp[:object], StripeObject).construct_from(resp, api_key)
|
||||
else
|
||||
resp
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user