Sha256: 929882e282deab7ed3fe527b479d60d14574b0789401b141ae88f0ec1e41dc1e
Contents?: true
Size: 642 Bytes
Versions: 7
Compression:
Stored size: 642 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 def update(partial_document, options = {}) @api_call.patch(endpoint_path, partial_document, options) end private def endpoint_path "#{Collections::RESOURCE_PATH}/#{@collection_name}#{Documents::RESOURCE_PATH}/#{@document_id}" end end end
Version data entries
7 entries across 7 versions & 1 rubygems