Class: Docker::Remote::BasicAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/docker/remote/basic_auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ BasicAuth

Returns a new instance of BasicAuth.



8
9
10
11
# File 'lib/docker/remote/basic_auth.rb', line 8

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

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/docker/remote/basic_auth.rb', line 6

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



6
7
8
# File 'lib/docker/remote/basic_auth.rb', line 6

def username
  @username
end

Instance Method Details

#make_get(path) ⇒ Object



13
14
15
16
17
# File 'lib/docker/remote/basic_auth.rb', line 13

def make_get(path)
  Net::HTTP::Get.new(path).tap do |request|
    request.basic_auth(username, password)
  end
end