Class: Typesense::Collection
- Inherits:
-
Object
- Object
- Typesense::Collection
- Defined in:
- lib/typesense/collection.rb
Instance Attribute Summary collapse
-
#documents ⇒ Object
readonly
Returns the value of attribute documents.
-
#overrides ⇒ Object
readonly
Returns the value of attribute overrides.
-
#synonyms ⇒ Object
readonly
Returns the value of attribute synonyms.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(name, api_call) ⇒ Collection
constructor
A new instance of Collection.
- #retrieve ⇒ Object
- #update(update_schema) ⇒ Object
Constructor Details
#initialize(name, api_call) ⇒ Collection
Returns a new instance of Collection.
7 8 9 10 11 12 13 |
# File 'lib/typesense/collection.rb', line 7 def initialize(name, api_call) @name = name @api_call = api_call @documents = Documents.new(@name, @api_call) @overrides = Overrides.new(@name, @api_call) @synonyms = Synonyms.new(@name, @api_call) end |
Instance Attribute Details
#documents ⇒ Object (readonly)
Returns the value of attribute documents.
5 6 7 |
# File 'lib/typesense/collection.rb', line 5 def documents @documents end |
#overrides ⇒ Object (readonly)
Returns the value of attribute overrides.
5 6 7 |
# File 'lib/typesense/collection.rb', line 5 def overrides @overrides end |
#synonyms ⇒ Object (readonly)
Returns the value of attribute synonyms.
5 6 7 |
# File 'lib/typesense/collection.rb', line 5 def synonyms @synonyms end |
Instance Method Details
#delete ⇒ Object
23 24 25 |
# File 'lib/typesense/collection.rb', line 23 def delete @api_call.delete(endpoint_path) end |
#retrieve ⇒ Object
15 16 17 |
# File 'lib/typesense/collection.rb', line 15 def retrieve @api_call.get(endpoint_path) end |
#update(update_schema) ⇒ Object
19 20 21 |
# File 'lib/typesense/collection.rb', line 19 def update(update_schema) @api_call.patch(endpoint_path, update_schema) end |