Class: Typesense::Document
- Inherits:
-
Object
- Object
- Typesense::Document
- Defined in:
- lib/typesense/document.rb
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(collection_name, document_id, api_call) ⇒ Document
constructor
A new instance of Document.
- #retrieve ⇒ Object
- #update(partial_document, options = {}) ⇒ Object
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
#delete ⇒ Object
15 16 17 |
# File 'lib/typesense/document.rb', line 15 def delete @api_call.delete(endpoint_path) end |
#retrieve ⇒ Object
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, = {}) @api_call.patch(endpoint_path, partial_document, ) end |