Class: Inspec::Resources::DockerImage
- Inherits:
-
Object
- Object
- Inspec::Resources::DockerImage
- Includes:
- DockerObject
- Defined in:
- lib/inspec/resources/docker_image.rb
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(opts = {}) ⇒ DockerImage
constructor
A new instance of DockerImage.
- #repo ⇒ Object
- #tag ⇒ Object
- #to_s ⇒ Object
Methods included from DockerObject
Constructor Details
#initialize(opts = {}) ⇒ DockerImage
Returns a new instance of DockerImage.
32 33 34 35 36 37 |
# File 'lib/inspec/resources/docker_image.rb', line 32 def initialize(opts = {}) # do sanitizion of input values o = opts.dup o = { image: opts } if opts.is_a?(String) @opts = (o) end |
Instance Method Details
#image ⇒ Object
39 40 41 |
# File 'lib/inspec/resources/docker_image.rb', line 39 def image "#{repo}:#{tag}" if object_info.entries.size == 1 end |
#repo ⇒ Object
43 44 45 |
# File 'lib/inspec/resources/docker_image.rb', line 43 def repo object_info.repositories[0] if object_info.entries.size == 1 end |
#tag ⇒ Object
47 48 49 |
# File 'lib/inspec/resources/docker_image.rb', line 47 def tag object_info.[0] if object_info.entries.size == 1 end |
#to_s ⇒ Object
51 52 53 54 |
# File 'lib/inspec/resources/docker_image.rb', line 51 def to_s img = @opts[:image] || @opts[:id] "Docker Image #{img}" end |