Class: Yobi::MatchesPerSnapshot
- 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
- #hits ⇒ Integer
-
#matches ⇒ Array[FindMatch]
An Array of Yobi::FindMatch objects for this snapshot.
-
#snapshot ⇒ String
(also: #snapshot_id)
Restic's own
find --jsonoutput only gives the snapshot's ID here, not a full record - unlike every other place in this API where "snapshot" means a Yobi::Snapshot.
Methods inherited from FancyHash
#initialize, #inspect, #pretty_print
Constructor Details
This class inherits a constructor from Yobi::FancyHash
Instance Method Details
#hits ⇒ Integer
108 109 110 |
# File 'lib/yobi/repository/find.rb', line 108 def hits self["hits"] end |
#matches ⇒ Array[FindMatch]
An Array of Yobi::FindMatch objects for this snapshot.
113 114 115 |
# File 'lib/yobi/repository/find.rb', line 113 def matches @matches ||= (self["matches"] || []).map { |raw| Yobi::FindMatch.new(raw) } end |
#snapshot ⇒ String 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.
103 104 105 |
# File 'lib/yobi/repository/find.rb', line 103 def snapshot self["snapshot"] end |