Class: Yobi::DiffOutcome
- Inherits:
-
Object
- Object
- Yobi::DiffOutcome
- Defined in:
- lib/yobi/repository/diff.rb,
sig/yobi.rbs
Overview
The outcome of one Repository#diff call.
Instance Attribute Summary collapse
- #output ⇒ Yobi::ResticOutput readonly
Instance Method Summary collapse
- #changes ⇒ Enumerable<Yobi::DiffChange>
-
#initialize(execution) ⇒ DiffOutcome
constructor
A new instance of DiffOutcome.
- #pretty_print(q) ⇒ void
-
#statistics ⇒ Yobi::DiffStatistics
(also: #report)
Restic's own
"statistics"fields.
Constructor Details
#initialize(execution) ⇒ DiffOutcome
Returns a new instance of DiffOutcome.
46 47 48 |
# File 'lib/yobi/repository/diff.rb', line 46 def initialize(execution) @output = execution[:output] end |
Instance Attribute Details
#output ⇒ Yobi::ResticOutput (readonly)
43 44 45 |
# File 'lib/yobi/repository/diff.rb', line 43 def output @output end |
Instance Method Details
#changes ⇒ Enumerable<Yobi::DiffChange>
57 58 59 |
# File 'lib/yobi/repository/diff.rb', line 57 def changes @changes ||= output.("change") end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
62 63 64 65 66 67 |
# File 'lib/yobi/repository/diff.rb', line 62 def pretty_print(q) q.object_group(self) do q.breakable q.pp statistics end end |
#statistics ⇒ Yobi::DiffStatistics Also known as: report
Returns Restic's own "statistics" fields.
51 52 53 |
# File 'lib/yobi/repository/diff.rb', line 51 def statistics @statistics ||= output.("statistics").first || DiffStatistics.new({}) end |