Class: Yobi::DiffOutcome

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution) ⇒ DiffOutcome

:nodoc:

Parameters:

  • execution (execution)


33
34
35
# File 'lib/yobi/repository/diff.rb', line 33

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

Instance Attribute Details

#outputResticOutput (readonly)

The Yobi::ResticOutput backing this outcome.

Returns:



31
32
33
# File 'lib/yobi/repository/diff.rb', line 31

def output
  @output
end

Instance Method Details

#changesResticOutput::LazyList[DiffChange]

Every Yobi::DiffChange from the run.



44
45
46
# File 'lib/yobi/repository/diff.rb', line 44

def changes
  @changes ||= output.messages("change")
end

#pretty_print(q) ⇒ Object



48
49
50
51
52
53
# File 'lib/yobi/repository/diff.rb', line 48

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

#statisticsDiffStatistics Also known as: report

The Yobi::DiffStatistics of Restic's own "statistics" fields.

Returns:



38
39
40
# File 'lib/yobi/repository/diff.rb', line 38

def statistics
  @statistics ||= output.messages("statistics").first || DiffStatistics.new({})
end