Sha256: d43e1cc3f2f02a29545fa1ab42aeae0fdfc4d990259ca10027f0471bcf9cafa2

Contents?: true

Size: 935 Bytes

Versions: 8

Compression:

Stored size: 935 Bytes

Contents

module LiveQA
  class APIOperation
    ##
    # == Delete a resource for the API
    #
    module Delete
      module ClassMethods
        ##
        # Delete an API Resource
        #
        # @param [String] id for the request
        # @param [Hash] Additional options for the request
        #
        # @return [LiveQA::Object] response from the API
        def delete(id, options = {})
          response = request(:delete, "#{resource_path}/#{id}", options)
          initialize_from(response)
        end
      end

      ##
      # Delete an API Resources
      #
      # @param [Hash] Additional options for the request
      #
      # @return [LiveQA::Object] response from the API
      def destroy(options = {})
        response = request(:delete, "#{resource_path}/#{id}", {}, options)
        update_from(response)
      end

      def self.included(base)
        base.extend(ClassMethods)
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
liveqa-1.9.6 lib/liveqa/api_operation/delete.rb
liveqa-1.9.5 lib/liveqa/api_operation/delete.rb
liveqa-1.9.4 lib/liveqa/api_operation/delete.rb
liveqa-1.9.3 lib/liveqa/api_operation/delete.rb
liveqa-1.9.2 lib/liveqa/api_operation/delete.rb
liveqa-1.9.1 lib/liveqa/api_operation/delete.rb
liveqa-1.9.0 lib/liveqa/api_operation/delete.rb
liveqa-1.8.3 lib/liveqa/api_operation/delete.rb