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)


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

def hits
  self["hits"]
end

#matchesArray<Yobi::FindMatch>

Returns:



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

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)


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

def snapshot
  self["snapshot"]
end