Class: Yobi::TagOutcome
- Inherits:
-
Struct
- Object
- Struct
- Yobi::TagOutcome
- Defined in:
- lib/yobi/repository/tag.rb,
sig/yobi.rbs
Overview
The outcome of one Repository#tag call.
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#changes ⇒ Array<Yobi::TagChange>
One per snapshot actually modified.
-
#report ⇒ Hash
Restic's own
"summary"fields ("changed_snapshots").
Instance Attribute Details
#exit_code ⇒ Object
Returns the value of attribute exit_code
35 36 37 |
# File 'lib/yobi/repository/tag.rb', line 35 def exit_code @exit_code end |
#output ⇒ Object
Returns the value of attribute output
35 36 37 |
# File 'lib/yobi/repository/tag.rb', line 35 def output @output end |
Instance Method Details
#changes ⇒ Array<Yobi::TagChange>
Returns one per snapshot actually modified.
42 43 44 45 46 47 48 49 |
# File 'lib/yobi/repository/tag.rb', line 42 def changes @changes ||= output.each_line.filter_map do |line| next if line.strip.empty? hash = JSON.parse(line) Yobi::TagChange.new(hash) if hash["message_type"] == "changed" end end |
#report ⇒ Hash
Returns Restic's own "summary" fields ("changed_snapshots").
37 38 39 |
# File 'lib/yobi/repository/tag.rb', line 37 def report @report ||= summary_hash end |