app/models/manager_refresh/inventory_collection/data_storage.rb
def primary_index_scan(hash)
        hash = enrich_data(hash)

        if manager_ref.any? { |x| !hash.key?(x) }
          raise "Needed find_or_build_by keys are: #{manager_ref}, data provided: #{hash}"
        end

        uuid = ::ManagerRefresh::InventoryCollection::Reference.build_stringified_reference(hash, named_ref)
        return hash, uuid, primary_index.find(uuid)
      end
# Scans primary index for existing InventoryObject, that would be equivalent to passed hash. It also returns
# enriched data and uuid, so we do not have to compute it multiple times.
#
# @param hash [Hash] Attributes for the InventoryObject
# @return [Array(Hash, String, ManagerRefresh::InventoryObject)] Returns enriched data, uuid and InventoryObject
# if found (otherwise nil)
Scans primary index for existing InventoryObject, that would be equivalent to passed hash. It also returns
enriched data and uuid, so we do not have to compute it multiple times.
Scans primary index for existing InventoryObject that would be equivalent to passed hash . It also returns enriched data and uuid so we do not have to compute it multiple times .
def primary_index_scan(hash)
        hash = enrich_data(hash)
        if manager_ref.any? { |x| !hash.key?(x) }
          raise "Needed find_or_build_by keys are: #{manager_ref}, data provided: #{hash}"
        end
        uuid = ::ManagerRefresh::InventoryCollection::Reference.build_stringified_reference(hash, named_ref)
        return hash, uuid, primary_index.find(uuid)
      end
def primary_index_scan ( hash ) hash = enrich_data ( hash ) if manager_ref . any? { | x | ! hash . key? ( x ) } raise "Needed find_or_build_by keys are: #{manager_ref}, data provided: #{hash}" end uuid = :: ManagerRefresh :: InventoryCollection :: Reference . build_stringified_reference ( hash , named_ref ) return hash , uuid , primary_index . find ( uuid ) end
Scans primary index for existing InventoryObject, that would be equivalent to passed hash.
Scans primary index for existing InventoryObject that would be equivalent to passed hash .
Returns enriched data, uuid and InventoryObject if found (otherwise nil)
Returns enriched data uuid and InventoryObject if found ( otherwise nil )
Array(Hash, String, ManagerRefresh::InventoryObject)
hash
Attributes for the InventoryObject
Attributes for the InventoryObject