Module: Typhoeus::EasyFu::Auth

Included in:
Typhoeus::Easy
Defined in:
lib/typhoeus/easy/auth.rb

Instance Method Summary collapse

Instance Method Details

#auth=(authinfo) ⇒ Object



4
5
6
7
# File 'lib/typhoeus/easy/auth.rb', line 4

def auth=(authinfo)
  set_option(:userpwd, auth_credentials(authinfo))
  set_option(:httpauth, Typhoeus::Easy::AUTH_TYPES[authinfo[:method]]) if authinfo[:method]
end

#auth_credentials(authinfo) ⇒ Object



9
10
11
# File 'lib/typhoeus/easy/auth.rb', line 9

def auth_credentials(authinfo)
  "#{authinfo[:username]}:#{authinfo[:password]}"
end