Sha256: e3b8c68424095a49265ff327463c3e80a113c52b638ea29970e2b4985c8f75b3

Contents?: true

Size: 522 Bytes

Versions: 12

Compression:

Stored size: 522 Bytes

Contents

# frozen_string_literal: true

module Typesense
  class Document
    def initialize(collection_name, document_id, api_call)
      @collection_name = collection_name
      @document_id     = document_id
      @api_call        = api_call
    end

    def retrieve
      @api_call.get(endpoint_path)
    end

    def delete
      @api_call.delete(endpoint_path)
    end

    private

    def endpoint_path
      "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Documents::RESOURCE_PATH}/#{@document_id}"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
typesense-0.8.0pre lib/typesense/document.rb
typesense-0.7.0 lib/typesense/document.rb
typesense-0.7.0.pre1 lib/typesense/document.rb
typesense-0.7.0.pre0 lib/typesense/document.rb
typesense-0.6.0 lib/typesense/document.rb
typesense-0.5.5 lib/typesense/document.rb
typesense-0.5.4 lib/typesense/document.rb
typesense-0.5.3 lib/typesense/document.rb
typesense-0.5.2 lib/typesense/document.rb
typesense-0.5.1 lib/typesense/document.rb
typesense-0.5.0 lib/typesense/document.rb
typesense-0.4.0 lib/typesense/document.rb