Class: Yobi::Snapshot

Inherits:
FancyHash show all
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

Methods inherited from FancyHash

#initialize, #inspect, #pretty_print

Constructor Details

This class inherits a constructor from Yobi::FancyHash

Instance Method Details

#hostString

Hostname recorded on the snapshot.

Returns:

  • (String)


25
26
27
# File 'lib/yobi/snapshot.rb', line 25

def host
  self["hostname"]
end

#idString

Full snapshot ID (64-char hex).

Returns:

  • (String)


10
11
12
# File 'lib/yobi/snapshot.rb', line 10

def id
  self["id"]
end

#parent_idString?

Parent snapshot's #id, if any.

Returns:

  • (String, nil)


40
41
42
# File 'lib/yobi/snapshot.rb', line 40

def parent_id
  self["parent"]
end

#pathsArray[String]

Paths backed up in the snapshot.

Returns:

  • (Array[String])


35
36
37
# File 'lib/yobi/snapshot.rb', line 35

def paths
  self["paths"]
end

#short_idString

First 8 chars of #id.

Returns:

  • (String)


15
16
17
# File 'lib/yobi/snapshot.rb', line 15

def short_id
  self["short_id"]
end

#summarySnapshotSummary

A Yobi::SnapshotSummary of the snapshot's stats at creation time.

Returns:



45
46
47
# File 'lib/yobi/snapshot.rb', line 45

def summary
  @summary ||= SnapshotSummary.new(self["summary"] || {})
end

#tagsArray[String]

Tags recorded on the snapshot.

Returns:

  • (Array[String])


30
31
32
# File 'lib/yobi/snapshot.rb', line 30

def tags
  @tags ||= self["tags"] || []
end

#timeTime

When the snapshot was created.

Returns:

  • (Time)


20
21
22
# File 'lib/yobi/snapshot.rb', line 20

def time
  @time ||= Time.parse(self["time"])
end