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 Yobi::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)


108
109
110
# File 'lib/yobi/repository/find.rb', line 108

def hits
  self["hits"]
end

#matchesArray[FindMatch]

An Array of Yobi::FindMatch objects for this snapshot.

Returns:



113
114
115
# File 'lib/yobi/repository/find.rb', line 113

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 Yobi::Snapshot. Call Yobi::Repository#snapshots yourself if you need the full record.

Returns:

  • (String)


103
104
105
# File 'lib/yobi/repository/find.rb', line 103

def snapshot
  self["snapshot"]
end