Class: DockerDistribution::CanonicalReference

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/docker_distribution/canonical_reference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, digest) ⇒ CanonicalReference

Returns a new instance of CanonicalReference.



10
11
12
13
# File 'lib/docker_distribution/canonical_reference.rb', line 10

def initialize(repository, digest)
  @repository = repository
  @digest = digest
end

Instance Attribute Details

#digestObject

Returns the value of attribute digest.



8
9
10
# File 'lib/docker_distribution/canonical_reference.rb', line 8

def digest
  @digest
end

#repositoryObject

Returns the value of attribute repository.



8
9
10
# File 'lib/docker_distribution/canonical_reference.rb', line 8

def repository
  @repository
end

Instance Method Details

#familiarObject



28
29
30
# File 'lib/docker_distribution/canonical_reference.rb', line 28

def familiar
  self.class.new(Normalize.familiarize_name(self), digest)
end

#to_hObject



19
20
21
22
23
24
25
26
# File 'lib/docker_distribution/canonical_reference.rb', line 19

def to_h
  {
    repository: name,
    domain: domain,
    path: path,
    digest: digest
  }
end

#to_sObject



15
16
17
# File 'lib/docker_distribution/canonical_reference.rb', line 15

def to_s
  [repository.name, digest].join("@")
end