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 Repository#snapshots, Repository#ls, and 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

Returns:

  • (String)


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

def host
  self["hostname"]
end

#idString

Returns:

  • (String)


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

def id
  self["id"]
end

#parent_idString?

Returns:

  • (String, nil)


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

def parent_id
  self["parent"]
end

#pathsArray<String>

Returns:

  • (Array<String>)


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

def paths
  self["paths"]
end

#short_idString

Returns:

  • (String)


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

def short_id
  self["short_id"]
end

#summaryYobi::SnapshotSummary



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

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

#tagsArray<String>

Returns:

  • (Array<String>)


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

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

#timeTime

Returns:

  • (Time)


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

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