Class: Yobi::CheckOutcome
- Inherits:
-
Object
- Object
- Yobi::CheckOutcome
- Defined in:
- lib/yobi/repository/check.rb,
sig/yobi.rbs
Overview
The outcome of one Repository#check call.
Instance Attribute Summary collapse
- #output ⇒ Yobi::ResticOutput readonly
Instance Method Summary collapse
- #errors ⇒ Enumerable<Yobi::CheckError>
-
#initialize(execution) ⇒ CheckOutcome
constructor
A new instance of CheckOutcome.
- #pretty_print(q) ⇒ void
-
#summary ⇒ Yobi::CheckSummary
(also: #report)
Restic's own
"summary"fields.
Constructor Details
#initialize(execution) ⇒ CheckOutcome
Returns a new instance of CheckOutcome.
54 55 56 |
# File 'lib/yobi/repository/check.rb', line 54 def initialize(execution) @output = execution[:output] end |
Instance Attribute Details
#output ⇒ Yobi::ResticOutput (readonly)
51 52 53 |
# File 'lib/yobi/repository/check.rb', line 51 def output @output end |
Instance Method Details
#errors ⇒ Enumerable<Yobi::CheckError>
65 66 67 |
# File 'lib/yobi/repository/check.rb', line 65 def errors @errors ||= output.("error") end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
70 71 72 73 74 75 76 77 |
# File 'lib/yobi/repository/check.rb', line 70 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 ⇒ Yobi::CheckSummary Also known as: report
Returns Restic's own "summary" fields.
59 60 61 |
# File 'lib/yobi/repository/check.rb', line 59 def summary @summary ||= output.("summary").first || CheckSummary.new({}) end |