class Cutlass::DockerDiff::DiffValue

Attributes

diff_ids[R]

Public Class Methods

new(before_ids:, now_ids:) click to toggle source
# File lib/cutlass/docker_diff.rb, line 29
def initialize(before_ids:, now_ids:)
  @diff_ids = now_ids - before_ids
end

Public Instance Methods

changed?() click to toggle source
# File lib/cutlass/docker_diff.rb, line 33
def changed?
  @diff_ids.any?
end
leaked_images() click to toggle source
# File lib/cutlass/docker_diff.rb, line 41
def leaked_images
  diff_ids.map do |id|
    Docker::Image.get(id)
  end
end
same?() click to toggle source
# File lib/cutlass/docker_diff.rb, line 37
def same?
  !changed?
end
to_s() click to toggle source
# File lib/cutlass/docker_diff.rb, line 47
def to_s
  leaked_images.map do |image|
    "  tags: #{image.info["RepoTags"]}, id: #{image.id}"
  end.join($/)
end