Class: Cutlass::DockerDiff::DiffValue
- Inherits:
-
Object
- Object
- Cutlass::DockerDiff::DiffValue
- Defined in:
- lib/cutlass/docker_diff.rb
Instance Attribute Summary collapse
-
#diff_ids ⇒ Object
readonly
Returns the value of attribute diff_ids.
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#initialize(before_ids:, now_ids:) ⇒ DiffValue
constructor
A new instance of DiffValue.
- #leaked_images ⇒ Object
- #same? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(before_ids:, now_ids:) ⇒ DiffValue
Returns a new instance of DiffValue.
29 30 31 |
# File 'lib/cutlass/docker_diff.rb', line 29 def initialize(before_ids:, now_ids:) @diff_ids = now_ids - before_ids end |
Instance Attribute Details
#diff_ids ⇒ Object (readonly)
Returns the value of attribute diff_ids.
27 28 29 |
# File 'lib/cutlass/docker_diff.rb', line 27 def diff_ids @diff_ids end |
Instance Method Details
#changed? ⇒ Boolean
33 34 35 |
# File 'lib/cutlass/docker_diff.rb', line 33 def changed? @diff_ids.any? end |
#leaked_images ⇒ Object
41 42 43 44 45 |
# File 'lib/cutlass/docker_diff.rb', line 41 def leaked_images diff_ids.map do |id| Docker::Image.get(id) end end |
#same? ⇒ Boolean
37 38 39 |
# File 'lib/cutlass/docker_diff.rb', line 37 def same? !changed? end |
#to_s ⇒ Object
47 48 49 50 51 |
# 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 |