Class: Yobi::CheckOutcome
- Inherits:
-
Object
- Object
- Yobi::CheckOutcome
- Defined in:
- lib/yobi/repository/check.rb,
sig/yobi.rbs
Overview
The outcome of one Yobi::Repository#check call.
Instance Attribute Summary collapse
-
#output ⇒ ResticOutput
readonly
The Yobi::ResticOutput backing this outcome.
Instance Method Summary collapse
-
#errors ⇒ ResticOutput::LazyList[CheckError]
Every Yobi::CheckError from the run.
-
#initialize(execution) ⇒ CheckOutcome
constructor
:nodoc:.
- #pretty_print(q) ⇒ Object
-
#summary ⇒ CheckSummary
(also: #report)
The Yobi::CheckSummary of Restic's own
"summary"fields.
Constructor Details
#initialize(execution) ⇒ CheckOutcome
:nodoc:
45 46 47 |
# File 'lib/yobi/repository/check.rb', line 45 def initialize(execution) # :nodoc: @output = execution[:output] end |
Instance Attribute Details
#output ⇒ ResticOutput (readonly)
The Yobi::ResticOutput backing this outcome.
43 44 45 |
# File 'lib/yobi/repository/check.rb', line 43 def output @output end |
Instance Method Details
#errors ⇒ ResticOutput::LazyList[CheckError]
Every Yobi::CheckError from the run.
56 57 58 |
# File 'lib/yobi/repository/check.rb', line 56 def errors @errors ||= output.("error") end |
#pretty_print(q) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/yobi/repository/check.rb', line 60 def pretty_print(q) q.object_group(self) do q.breakable q.text("(has errors)") if errors.any? q.breakable q.pp summary end end |
#summary ⇒ CheckSummary Also known as: report
The Yobi::CheckSummary of Restic's own "summary" fields.
50 51 52 |
# File 'lib/yobi/repository/check.rb', line 50 def summary @summary ||= output.("summary").first || CheckSummary.new({}) end |