Class: WebfleetConnect::Credentials

Inherits:
Object
  • Object
show all
Includes:
Helpers::EncodingHelper
Defined in:
lib/webfleet_connect/credentials.rb

Instance Method Summary collapse

Methods included from Helpers::EncodingHelper

#base64_encode

Constructor Details

#initialize(args = {}) ⇒ Credentials

Returns a new instance of Credentials.



6
7
8
9
10
11
12
# File 'lib/webfleet_connect/credentials.rb', line 6

def initialize(args = {})
  args = default_arguments.merge(args)
  @account  = args[:account]
  @username = args[:username]
  @password = args[:password]
  @apikey   = args[:apikey]
end

Instance Method Details

#auth_headerObject



14
15
16
# File 'lib/webfleet_connect/credentials.rb', line 14

def auth_header
  "Authorization: Basic #{encode}"
end

#to_sObject



18
19
20
# File 'lib/webfleet_connect/credentials.rb', line 18

def to_s
  "#{}&#{username}&#{password}&#{apikey}"
end