Class: Yobi::LsOutcome

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

Overview

The outcome of one Repository#ls call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution) ⇒ LsOutcome

Returns a new instance of LsOutcome.

Parameters:

  • execution (execution)


64
65
66
# File 'lib/yobi/repository/ls.rb', line 64

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

Instance Attribute Details

#outputYobi::ResticOutput (readonly)

Returns:



61
62
63
# File 'lib/yobi/repository/ls.rb', line 61

def output
  @output
end

Instance Method Details

#nodesEnumerable<Yobi::Node> Also known as: entries

Returns:



74
75
76
# File 'lib/yobi/repository/ls.rb', line 74

def nodes
  @nodes ||= output.messages("node")
end

#pretty_print(q) ⇒ void

This method returns an undefined value.



80
81
82
83
84
85
86
87
# File 'lib/yobi/repository/ls.rb', line 80

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

#snapshotYobi::Snapshot

Returns the resolved snapshot, useful when snapshot_id: was "latest".

Returns:

  • (Yobi::Snapshot)

    the resolved snapshot, useful when snapshot_id: was "latest"



69
70
71
# File 'lib/yobi/repository/ls.rb', line 69

def snapshot
  @snapshot ||= output.messages("snapshot").first
end