Class: Yobi::LsOutcome

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution) ⇒ LsOutcome

:nodoc:

Parameters:

  • execution (execution)


53
54
55
# File 'lib/yobi/repository/ls.rb', line 53

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

Instance Attribute Details

#outputResticOutput (readonly)

The Yobi::ResticOutput backing this outcome.

Returns:



51
52
53
# File 'lib/yobi/repository/ls.rb', line 51

def output
  @output
end

Instance Method Details

#nodesResticOutput::LazyList[Node] Also known as: entries

Every Yobi::Node from the run.



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

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

#pretty_print(q) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/yobi/repository/ls.rb', line 68

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

#snapshotSnapshot

The resolved Yobi::Snapshot, useful when snapshot_id: was "latest".

Returns:



58
59
60
# File 'lib/yobi/repository/ls.rb', line 58

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