Class: RedfishTools::Recorder

Inherits:
Object
  • Object
show all
Defined in:
lib/redfish_tools/recorder.rb

Overview

Recorder represents entry point into mock creation process.

Instance Method Summary collapse

Constructor Details

#initialize(client, disk_path) ⇒ Recorder

Returns a new instance of Recorder.



10
11
12
13
14
15
# File 'lib/redfish_tools/recorder.rb', line 10

def initialize(client, disk_path)
  raise "Directory '#{disk_path}' exists" if File.directory?(disk_path)

  @path = disk_path
  @client = client
end

Instance Method Details

#recordObject



17
18
19
20
21
22
23
24
25
# File 'lib/redfish_tools/recorder.rb', line 17

def record
  visited = Set.new
  batch = Set.new([@client["@odata.id"]])

  until batch.empty?
    visited.merge(batch)
    batch = process_oid_batch(batch, visited)
  end
end