Class: Typesense::Collection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#documentsObject (readonly)

Returns the value of attribute documents.



5
6
7
# File 'lib/typesense/collection.rb', line 5

def documents
  @documents
end

#overridesObject (readonly)

Returns the value of attribute overrides.



5
6
7
# File 'lib/typesense/collection.rb', line 5

def overrides
  @overrides
end

#synonymsObject (readonly)

Returns the value of attribute synonyms.



5
6
7
# File 'lib/typesense/collection.rb', line 5

def synonyms
  @synonyms
end

Instance Method Details

#deleteObject



23
24
25
# File 'lib/typesense/collection.rb', line 23

def delete
  @api_call.delete(endpoint_path)
end

#retrieveObject



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