lib/nubank_sdk/auth.rb in nubank_sdk-0.5.2 vs lib/nubank_sdk/auth.rb in nubank_sdk-0.6.0

- old
+ new

@@ -143,14 +143,14 @@ # # @param [Hash] links the new links to add # # @return [NubankSdk::ApiRoutes] the api routes with the new links def update_api_routes(links) - feed_url_keys = ['events', 'magnitude'] - bills_url_keys = ['bills_summary'] - customer_url_keys = ['customer'] - account_url_keys = ['account'] + feed_url_keys = [:events, :magnitude] + bills_url_keys = [:bills_summary] + customer_url_keys = [:customer] + account_url_keys = [:account] @api_routes.add_entrypoint(path: :ssl, entrypoint: :revoke_token, url: links[:revoke_token][:href]) @api_routes.add_entrypoint(path: :ssl, entrypoint: :query, url: links[:ghostflame][:href]) @api_routes.add_entrypoint(path: :ssl, entrypoint: :feed, url: find_url(feed_url_keys, links)) @api_routes.add_entrypoint(path: :ssl, entrypoint: :bills, url: find_url(bills_url_keys, links)) @api_routes.add_entrypoint(path: :ssl, entrypoint: :customer, url: find_url(customer_url_keys, links)) @@ -167,10 +167,10 @@ # @return [String] the url of the first key found def find_url(keys, list) links_keys = list.keys keys.each do |url_key| - return list[url_key]['href'] if links_keys.include?(url_key) + return list[url_key][:href] if links_keys.include?(url_key) end '' end # @!visibility private