Class: Yobi::RestoreOutcome

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

Overview

The outcome of one Yobi::Repository#restore call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution) ⇒ RestoreOutcome

Returns a new instance of RestoreOutcome.

Parameters:

  • execution (execution)


95
96
97
# File 'lib/yobi/repository/restore.rb', line 95

def initialize(execution)
  @output = execution[:output]
end

Instance Attribute Details

#outputYobi::ResticOutput (readonly)

Returns:



92
93
94
# File 'lib/yobi/repository/restore.rb', line 92

def output
  @output
end

Instance Method Details

#pretty_print(q) ⇒ void

This method returns an undefined value.



106
107
108
109
110
111
# File 'lib/yobi/repository/restore.rb', line 106

def pretty_print(q)
  q.object_group(self) do
    q.breakable
    q.pp summary
  end
end

#summaryHash Also known as: report

Returns Restic's own "summary" fields ("total_files", "files_restored", ...).

Returns:

  • (Hash)

    Restic's own "summary" fields ("total_files", "files_restored", ...)



100
101
102
# File 'lib/yobi/repository/restore.rb', line 100

def summary
  @summary ||= output.messages("summary").first || {}
end