Class: Typesense::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/typesense/document.rb

Instance Method Summary collapse

Constructor Details

#initialize(collection_name, document_id, api_call) ⇒ Document

Returns a new instance of Document.



5
6
7
8
9
# File 'lib/typesense/document.rb', line 5

def initialize(collection_name, document_id, api_call)
  @collection_name = collection_name
  @document_id     = document_id
  @api_call        = api_call
end

Instance Method Details

#deleteObject



15
16
17
# File 'lib/typesense/document.rb', line 15

def delete
  @api_call.delete(endpoint_path)
end

#retrieveObject



11
12
13
# File 'lib/typesense/document.rb', line 11

def retrieve
  @api_call.get(endpoint_path)
end

#update(partial_document, options = {}) ⇒ Object



19
20
21
# File 'lib/typesense/document.rb', line 19

def update(partial_document, options = {})
  @api_call.patch(endpoint_path, partial_document, options)
end