def load_collection
      case response = Resource::Base.connection.get(endpoint)
      when Array
        if response.first.is_a?(Hash)
          key = klass.schema.primary_key.to_s

          {}.tap do |hash|
            response.each do |results|
              results.each do |_, info|
                hash[key] = klass.resource_path(info[key])
              end
            end
          end
        else
          Hash[*response.map { |item| [item, klass.resource_path(item)] }.flatten]
        end
      when Hash
        response
      end
    end
def load_collection
      case response = Resource::Base.connection.get(endpoint)
      when Array
        if response.first.is_a?(Hash)
          key = klass.schema.primary_key.to_s

          {}.tap do |hash|
            response.each do |results|
              results.each do |_, info|
                hash[key] = klass.resource_path(info[key])
              end
            end
          end
        else
          Hash[*response.map { |item| [item, klass.resource_path(item)] }.flatten]
        end
      when Hash
        response
      end
    end
Fetch the object collection from the Chef Server. Since the Chef Server's
 API is completely insane and all over the place, it might return a Hash
 where the key is the id of the resource and the value is the url for that
 item on the Chef Server:

     { "key" => "url" }

 Or if the Chef Server's fancy is tickled, it might just return an array
 of the list of items:

     ["item_1", "item_2"]

 Or if the Chef Server is feeling especially magical, it might return the
 actual objects, but prefixed with the JSON id:

     [{"organization" => {"_id" => "..."}}, {"organization" => {...}}]

 So, this method attempts to intelligent handle these use cases. That being
 said, I can almost guarantee that someone is going to do some crazy
 strange edge case with this library and hit a bug here, so it will likely
 be changed in the future. For now, it "works on my machine".

 @return [Hash]