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

:nodoc:

Parameters:

  • execution (execution)


81
82
83
# File 'lib/yobi/repository/restore.rb', line 81

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

Instance Attribute Details

#outputResticOutput (readonly)

The Yobi::ResticOutput backing this outcome.

Returns:



79
80
81
# File 'lib/yobi/repository/restore.rb', line 79

def output
  @output
end

Instance Method Details

#pretty_print(q) ⇒ Object



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

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

#summaryHash[String, untyped] Also known as: report

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

Returns:

  • (Hash[String, untyped])


86
87
88
# File 'lib/yobi/repository/restore.rb', line 86

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