Class: CodexSDK::RolloutContextSnapshotReader

Inherits:
Object
  • Object
show all
Defined in:
lib/codex_sdk/rollout_context_snapshot_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(sessions_root:, started_at:) ⇒ RolloutContextSnapshotReader

Returns a new instance of RolloutContextSnapshotReader.



7
8
9
10
# File 'lib/codex_sdk/rollout_context_snapshot_reader.rb', line 7

def initialize(sessions_root:, started_at:)
  @sessions_root = sessions_root
  @started_at = started_at
end

Instance Method Details

#readObject



12
13
14
15
16
17
18
19
# File 'lib/codex_sdk/rollout_context_snapshot_reader.rb', line 12

def read
  candidate_rollouts.reverse_each do |path|
    snapshot = read_rollout(path)
    return snapshot if snapshot
  end

  nil
end