Class: Microsandbox::ImageInfo
- Inherits:
-
Object
- Object
- Microsandbox::ImageInfo
- Defined in:
- lib/microsandbox/image.rb
Overview
Metadata for a cached OCI image, from Microsandbox::Image.get / Microsandbox::Image.list.
Instance Attribute Summary collapse
-
#architecture ⇒ Object
readonly
Returns the value of attribute architecture.
-
#layer_count ⇒ Object
readonly
Returns the value of attribute layer_count.
-
#manifest_digest ⇒ Object
readonly
Returns the value of attribute manifest_digest.
-
#os ⇒ Object
readonly
Returns the value of attribute os.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#size_bytes ⇒ Object
readonly
Returns the value of attribute size_bytes.
Instance Method Summary collapse
- #created_at ⇒ Time?
-
#initialize(data) ⇒ ImageInfo
constructor
A new instance of ImageInfo.
- #inspect ⇒ Object
- #last_used_at ⇒ Time?
Constructor Details
#initialize(data) ⇒ ImageInfo
Returns a new instance of ImageInfo.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/microsandbox/image.rb', line 8 def initialize(data) @reference = data["reference"] @size_bytes = data["size_bytes"] @manifest_digest = data["manifest_digest"] @architecture = data["architecture"] @os = data["os"] @layer_count = data["layer_count"] @created_at_ms = data["created_at_ms"] @last_used_at_ms = data["last_used_at_ms"] end |
Instance Attribute Details
#architecture ⇒ Object (readonly)
Returns the value of attribute architecture.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def architecture @architecture end |
#layer_count ⇒ Object (readonly)
Returns the value of attribute layer_count.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def layer_count @layer_count end |
#manifest_digest ⇒ Object (readonly)
Returns the value of attribute manifest_digest.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def manifest_digest @manifest_digest end |
#os ⇒ Object (readonly)
Returns the value of attribute os.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def os @os end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def reference @reference end |
#size_bytes ⇒ Object (readonly)
Returns the value of attribute size_bytes.
6 7 8 |
# File 'lib/microsandbox/image.rb', line 6 def size_bytes @size_bytes end |
Instance Method Details
#created_at ⇒ Time?
20 21 22 |
# File 'lib/microsandbox/image.rb', line 20 def created_at @created_at_ms && Time.at(@created_at_ms / 1000.0) end |
#inspect ⇒ Object
29 30 31 |
# File 'lib/microsandbox/image.rb', line 29 def inspect "#<Microsandbox::ImageInfo reference=#{@reference.inspect} layers=#{@layer_count}>" end |
#last_used_at ⇒ Time?
25 26 27 |
# File 'lib/microsandbox/image.rb', line 25 def last_used_at @last_used_at_ms && Time.at(@last_used_at_ms / 1000.0) end |