Class: Yobi::TagOutcome
- Inherits:
-
Object
- Object
- Yobi::TagOutcome
- Defined in:
- lib/yobi/repository/tag.rb,
sig/yobi.rbs
Overview
The outcome of one Repository#tag call.
Instance Attribute Summary collapse
- #output ⇒ Yobi::ResticOutput readonly
Instance Method Summary collapse
-
#changes ⇒ Enumerable<Yobi::TagChange>
One per snapshot actually modified.
-
#initialize(execution) ⇒ TagOutcome
constructor
A new instance of TagOutcome.
- #pretty_print(q) ⇒ void
-
#summary ⇒ Yobi::TagSummary
(also: #report)
Restic's own
"summary"fields ("changed_snapshots").
Constructor Details
#initialize(execution) ⇒ TagOutcome
Returns a new instance of TagOutcome.
57 58 59 |
# File 'lib/yobi/repository/tag.rb', line 57 def initialize(execution) @output = execution[:output] end |
Instance Attribute Details
#output ⇒ Yobi::ResticOutput (readonly)
54 55 56 |
# File 'lib/yobi/repository/tag.rb', line 54 def output @output end |
Instance Method Details
#changes ⇒ Enumerable<Yobi::TagChange>
Returns one per snapshot actually modified.
68 69 70 |
# File 'lib/yobi/repository/tag.rb', line 68 def changes @changes ||= output.("changed") end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
73 74 75 76 77 78 |
# File 'lib/yobi/repository/tag.rb', line 73 def pretty_print(q) q.object_group(self) do q.breakable q.pp summary end end |
#summary ⇒ Yobi::TagSummary Also known as: report
Returns Restic's own "summary" fields ("changed_snapshots").
62 63 64 |
# File 'lib/yobi/repository/tag.rb', line 62 def summary @summary ||= output.("summary").first || TagSummary.new({}) end |