Class: Yobi::MatchesPerSnapshot

Inherits:
FancyHash
  • Object
show all
Defined in:
lib/yobi/repository/find.rb,
sig/yobi.rbs

Overview

One snapshot's worth of matches from a Repository#find call.

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

#hitsInteger

Returns:

  • (Integer)


129
130
131
# File 'lib/yobi/repository/find.rb', line 129

def hits
  self["hits"]
end

#matchesArray<Yobi::FindMatch>

Returns:



134
135
136
# File 'lib/yobi/repository/find.rb', line 134

def matches
  @matches ||= (self["matches"] || []).map { |raw| Yobi::FindMatch.new(raw) }
end

#snapshotString Also known as: snapshot_id

Restic's own find --json output only gives the snapshot's ID here, not a full record - unlike every other place in this API where "snapshot" means a Snapshot. Call Repository#snapshots yourself if you need the full record.

Returns:

  • (String)


123
124
125
# File 'lib/yobi/repository/find.rb', line 123

def snapshot
  self["snapshot"]
end