Module: Tagfish::DockerRegistryClient

Defined in:
lib/tagfish/docker_registry_client.rb

Defined Under Namespace

Classes: APIVersionError, AuthenticationError

Class Method Summary collapse

Class Method Details

.for(*args) ⇒ Object

Raises:



7
8
9
10
11
12
13
14
15
# File 'lib/tagfish/docker_registry_client.rb', line 7

def self.for(*args)
  [DockerRegistryV2Client, DockerRegistryV1Client].each do |client_class|
    begin 
      return client_class.new(*args)
    rescue APIVersionError
    end
  end
  raise APIVersionError, "API version unrecognized!"
end