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(creds) ⇒ BasicAuth

Returns a new instance of BasicAuth.



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

def initialize(creds)
  @creds = creds
end

Instance Attribute Details

#credsObject (readonly)

Returns the value of attribute creds.



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

def creds
  @creds
end

Instance Method Details

#make_get(path) ⇒ Object



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

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