Class: Yobi::TagOutcome

Inherits:
Struct
  • Object
show all
Defined in:
lib/yobi/repository/tag.rb,
sig/yobi.rbs

Overview

The outcome of one Repository#tag call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exit_codeObject

Returns the value of attribute exit_code

Returns:

  • (Object)

    the current value of exit_code



35
36
37
# File 'lib/yobi/repository/tag.rb', line 35

def exit_code
  @exit_code
end

#outputObject

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



35
36
37
# File 'lib/yobi/repository/tag.rb', line 35

def output
  @output
end

Instance Method Details

#changesArray<Yobi::TagChange>

Returns one per snapshot actually modified.

Returns:



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

#reportHash

Returns Restic's own "summary" fields ("changed_snapshots").

Returns:

  • (Hash)

    Restic's own "summary" fields ("changed_snapshots")



37
38
39
# File 'lib/yobi/repository/tag.rb', line 37

def report
  @report ||= summary_hash
end