Class: Armada::Docker::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/armada/docker/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, username, password, email) ⇒ Credentials

Returns a new instance of Credentials.



39
40
41
42
43
44
# File 'lib/armada/docker/config.rb', line 39

def initialize(url, username, password, email)
  @username = username
  @password = password
  @email = email
  @url = url
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



38
39
40
# File 'lib/armada/docker/config.rb', line 38

def email
  @email
end

#passwordObject (readonly)

Returns the value of attribute password.



38
39
40
# File 'lib/armada/docker/config.rb', line 38

def password
  @password
end

#urlObject (readonly)

Returns the value of attribute url.



38
39
40
# File 'lib/armada/docker/config.rb', line 38

def url
  @url
end

#usernameObject (readonly)

Returns the value of attribute username.



38
39
40
# File 'lib/armada/docker/config.rb', line 38

def username
  @username
end

Class Method Details

.dummyObject



51
52
53
# File 'lib/armada/docker/config.rb', line 51

def self.dummy()
  self.new '', nil, nil, ''
end

.parse(url, obj) ⇒ Object



46
47
48
49
# File 'lib/armada/docker/config.rb', line 46

def self.parse(url, obj)
  username, password = Base64.decode64(obj["auth"]).split(':', 2)
  return self.new url, username, password, obj["email"]
end