Class: InventoryRefresh::SaveCollection::Recursive

Inherits:
Base
  • Object
show all
Defined in:
lib/inventory_refresh/save_collection/recursive.rb

Class Method Summary collapse

Methods inherited from Base

save_inventory_object_inventory

Methods included from Logging

#logger

Class Method Details

.save_collections(ems, inventory_collections) ⇒ Object

Saves the passed InventoryCollection objects by recursively passing the graph

Parameters:

  • ems (ExtManagementSystem)

    manager owning the inventory_collections

  • inventory_collections (Array<InventoryRefresh::InventoryCollection>)

    array of InventoryCollection objects for saving



11
12
13
14
15
16
17
18
# File 'lib/inventory_refresh/save_collection/recursive.rb', line 11

def save_collections(ems, inventory_collections)
  graph = InventoryRefresh::InventoryCollection::Graph.new(inventory_collections)
  graph.build_directed_acyclic_graph!

  graph.nodes.each do |inventory_collection|
    save_collection(ems, inventory_collection, [])
  end
end