Class: Typesense::CurationSets

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

Constant Summary collapse

RESOURCE_PATH =
'/curation_sets'

Instance Method Summary collapse

Constructor Details

#initialize(api_call) ⇒ CurationSets

Returns a new instance of CurationSets.



7
8
9
# File 'lib/typesense/curation_sets.rb', line 7

def initialize(api_call)
  @api_call = api_call
end

Instance Method Details

#[](curation_set_name) ⇒ Object



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

def [](curation_set_name)
  CurationSet.new(curation_set_name, @api_call)
end

#retrieveObject



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

def retrieve
  @api_call.get(self.class::RESOURCE_PATH)
end

#upsert(curation_set_name, curation_set_data) ⇒ Object



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

def upsert(curation_set_name, curation_set_data)
  @api_call.put("#{self.class::RESOURCE_PATH}/#{URI.encode_www_form_component(curation_set_name)}", curation_set_data)
end