Class: Yobi::MatchesPerSnapshot
- 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
- #hits ⇒ Integer
- #matches ⇒ Array<Yobi::FindMatch>
-
#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 Snapshot.
Methods inherited from FancyHash
#initialize, #inspect, #pretty_print
Constructor Details
This class inherits a constructor from Yobi::FancyHash
Instance Method Details
#hits ⇒ Integer
129 130 131 |
# File 'lib/yobi/repository/find.rb', line 129 def hits self["hits"] end |
#matches ⇒ Array<Yobi::FindMatch>
134 135 136 |
# File 'lib/yobi/repository/find.rb', line 134 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 Snapshot. Call Repository#snapshots
yourself if you need the full record.
123 124 125 |
# File 'lib/yobi/repository/find.rb', line 123 def snapshot self["snapshot"] end |