Class: Yobi::RestoreOutcome
- Inherits:
-
Object
- Object
- Yobi::RestoreOutcome
- Defined in:
- lib/yobi/repository/restore.rb,
sig/yobi.rbs
Overview
The outcome of one Yobi::Repository#restore call.
Instance Attribute Summary collapse
- #output ⇒ Yobi::ResticOutput readonly
Instance Method Summary collapse
-
#initialize(execution) ⇒ RestoreOutcome
constructor
A new instance of RestoreOutcome.
- #pretty_print(q) ⇒ void
-
#summary ⇒ Hash
(also: #report)
Restic's own
"summary"fields ("total_files","files_restored", ...).
Constructor Details
#initialize(execution) ⇒ RestoreOutcome
Returns a new instance of RestoreOutcome.
95 96 97 |
# File 'lib/yobi/repository/restore.rb', line 95 def initialize(execution) @output = execution[:output] end |
Instance Attribute Details
#output ⇒ Yobi::ResticOutput (readonly)
92 93 94 |
# File 'lib/yobi/repository/restore.rb', line 92 def output @output end |
Instance Method Details
#pretty_print(q) ⇒ void
This method returns an undefined value.
106 107 108 109 110 111 |
# File 'lib/yobi/repository/restore.rb', line 106 def pretty_print(q) q.object_group(self) do q.breakable q.pp summary end end |
#summary ⇒ Hash Also known as: report
Returns Restic's own "summary" fields ("total_files", "files_restored", ...).
100 101 102 |
# File 'lib/yobi/repository/restore.rb', line 100 def summary @summary ||= output.("summary").first || {} end |