Method: BitBucket::Request::BasicAuth#initialize
- Defined in:
- lib/bitbucket_rest_api/request/basic_auth.rb
#initialize(app, *args) ⇒ BasicAuth
Returns a new instance of BasicAuth.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bitbucket_rest_api/request/basic_auth.rb', line 17 def initialize(app, *args) @app = app credentials = "" = args. if .has_key? :login credentials = "#{[:login]}:#{[:password]}" elsif .has_key? :basic_auth credentials = "#{[:basic_auth]}" end @auth = Base64.encode64(credentials) @auth.gsub!("\n", "") end |