Class: InventoryRefresh::SaveInventory
- Inherits:
-
Object
- Object
- InventoryRefresh::SaveInventory
- Extended by:
- Logging
- Defined in:
- lib/inventory_refresh/save_inventory.rb
Class Method Summary collapse
-
.save_inventory(ems, inventory_collections, strategy = nil) ⇒ Object
Saves the passed InventoryCollection objects.
Methods included from Logging
Class Method Details
.save_inventory(ems, inventory_collections, strategy = nil) ⇒ Object
Saves the passed InventoryCollection objects
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/inventory_refresh/save_inventory.rb', line 14 def save_inventory(ems, inventory_collections, strategy = nil) logger.debug("#{log_header(ems)} Scanning Inventory Collections...Start") InventoryRefresh::InventoryCollection::Scanner.scan!(inventory_collections) logger.debug("#{log_header(ems)} Scanning Inventory Collections...Complete") logger.info("#{log_header(ems)} Saving EMS Inventory...") if strategy.try(:to_sym) == :recursive InventoryRefresh::SaveCollection::Recursive.save_collections(ems, inventory_collections) else InventoryRefresh::SaveCollection::TopologicalSort.save_collections(ems, inventory_collections) end logger.info("#{log_header(ems)} Saving EMS Inventory...Complete") ems end |