Sha256: 1b739630760784427365d565ade8bd4a87ddae114be8edd0595d3460cacadbc5

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

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

    def retrieve
      ApiCall.new(@configuration).get(endpoint_path)
    end

    def delete
      ApiCall.new(@configuration).delete(endpoint_path)
    end

    private

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
typesense-0.2.0 lib/typesense/document.rb
typesense-0.1.1 lib/typesense/document.rb
typesense-0.1.0 lib/typesense/document.rb