Class: Yobi::Snapshot
- Defined in:
- lib/yobi/snapshot.rb,
sig/yobi.rbs
Overview
One snapshot, as Restic reports it. Shared across Yobi::Repository#snapshots, Yobi::Repository#ls, and Yobi::Repository#forget's keep/remove entries.
Instance Method Summary collapse
-
#host ⇒ String
Hostname recorded on the snapshot.
-
#id ⇒ String
Full snapshot ID (64-char hex).
-
#parent_id ⇒ String?
Parent snapshot's #id, if any.
-
#paths ⇒ Array[String]
Paths backed up in the snapshot.
-
#short_id ⇒ String
First 8 chars of #id.
-
#summary ⇒ SnapshotSummary
A Yobi::SnapshotSummary of the snapshot's stats at creation time.
-
#tags ⇒ Array[String]
Tags recorded on the snapshot.
-
#time ⇒ Time
When the snapshot was created.
Methods inherited from FancyHash
#initialize, #inspect, #pretty_print
Constructor Details
This class inherits a constructor from Yobi::FancyHash
Instance Method Details
#host ⇒ String
Hostname recorded on the snapshot.
25 26 27 |
# File 'lib/yobi/snapshot.rb', line 25 def host self["hostname"] end |
#id ⇒ String
Full snapshot ID (64-char hex).
10 11 12 |
# File 'lib/yobi/snapshot.rb', line 10 def id self["id"] end |
#parent_id ⇒ String?
Parent snapshot's #id, if any.
40 41 42 |
# File 'lib/yobi/snapshot.rb', line 40 def parent_id self["parent"] end |
#paths ⇒ Array[String]
Paths backed up in the snapshot.
35 36 37 |
# File 'lib/yobi/snapshot.rb', line 35 def paths self["paths"] end |
#short_id ⇒ String
First 8 chars of #id.
15 16 17 |
# File 'lib/yobi/snapshot.rb', line 15 def short_id self["short_id"] end |
#summary ⇒ SnapshotSummary
A Yobi::SnapshotSummary of the snapshot's stats at creation time.
45 46 47 |
# File 'lib/yobi/snapshot.rb', line 45 def summary @summary ||= SnapshotSummary.new(self["summary"] || {}) end |
#tags ⇒ Array[String]
Tags recorded on the snapshot.
30 31 32 |
# File 'lib/yobi/snapshot.rb', line 30 def @tags ||= self["tags"] || [] end |
#time ⇒ Time
When the snapshot was created.
20 21 22 |
# File 'lib/yobi/snapshot.rb', line 20 def time @time ||= Time.parse(self["time"]) end |