app/models/manager_refresh/inventory_collection.rb
def extract_references(new_references = [])
      # TODO(lsmola) Remove this when we allow only ManagerRefresh::InventoryCollection::Reference, decoding/encoding
      # from string is ugly
      hash_uuids_by_ref = []

      new_references.each do |index_value|
        next if index_value.nil?
        # TODO(lsmola) no need when hashes are the original hashes
        uuids = index_value.split("__")

        reference = {}
        manager_ref.each_with_index do |ref, uuid_value|
          reference[ref] = uuids[uuid_value]
        end
        hash_uuids_by_ref << reference
      end
      hash_uuids_by_ref
    end
# Extracting references to a relation friendly format
#
# @param new_references [Array<String>] array of index_values of the InventoryObjects
# @return [Array<Hash>] extracted references
Extracting references to a relation friendly format
Extracting references to a relation friendly format
def extract_references(new_references = [])
      hash_uuids_by_ref = []
      new_references.each do |index_value|
        next if index_value.nil?
        uuids = index_value.split("__")
        reference = {}
        manager_ref.each_with_index do |ref, uuid_value|
          reference[ref] = uuids[uuid_value]
        end
        hash_uuids_by_ref << reference
      end
      hash_uuids_by_ref
    end
def extract_references ( new_references = [ ] ) hash_uuids_by_ref = [ ] new_references . each do | index_value | next if index_value . nil? uuids = index_value . split ( "__" ) reference = { } manager_ref . each_with_index do | ref , uuid_value | reference [ ref ] = uuids [ uuid_value ] end hash_uuids_by_ref << reference end hash_uuids_by_ref end
Extracting references to a relation friendly format
Extracting references to a relation friendly format
# TODO(lsmola) Remove this when we allow only ManagerRefresh::InventoryCollection::Reference, decoding/encoding # from string is ugly # TODO(lsmola) no need when hashes are the original hashes
None
Array<Hash>
new_references
array of index_values of the InventoryObjects
array of index_values of the InventoryObjects