Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_auth_details_to_options(args)
- if @auth_details
- options = {}
- if args.size > 1
- options = args[1]
- end
- if @auth_details.has_key? :access_token
- options[:headers] = {
- "Authorization" => "Bearer #{@auth_details[:access_token]}" }
- elsif @auth_details.has_key? :api_key
- if not options.has_key? :basic_auth
- options[:basic_auth] = {
- :username => @auth_details[:api_key], :password => 'x' }
- end
- end
- args[1] = options
- end
- args
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement