Class: DockerDistribution::TaggedReference

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository = nil, tag = nil) ⇒ TaggedReference

Returns a new instance of TaggedReference.



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

def initialize(repository = nil, tag = nil)
  @repository = repository
  @tag = tag
end

Instance Attribute Details

#repositoryObject

Returns the value of attribute repository.



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

def repository
  @repository
end

#tagObject

Returns the value of attribute tag.



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

def tag
  @tag
end

Instance Method Details

#familiarObject



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

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

#to_hObject



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

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

#to_sObject



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

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