Advertisement
Guest User

Untitled

a guest
May 19th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def add_auth_details_to_options(options)
  2. return unless @auth_details
  3.  
  4. if @auth_details.has_key? :access_token
  5. options[:headers] = {
  6. "Authorization" => "Bearer #{@auth_details[:access_token]}" }
  7. elsif @auth_details.has_key? :api_key
  8. if not options.has_key? :basic_auth
  9. options[:basic_auth] = {
  10. :username => @auth_details[:api_key], :password => 'x' }
  11. end
  12. end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement