Class: Conquiro::SearchAPI::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/conquiro/search_api/client.rb

Instance Method Summary collapse

Instance Method Details

#query(params) ⇒ Object



10
11
12
13
14
# File 'lib/conquiro/search_api/client.rb', line 10

def query(params)
  params = strip_empty(params)
  response = self.class.get('/search', query: params)
  JSON.parse(response).with_indifferent_access
end

#strip_empty(params) ⇒ Object



16
17
18
# File 'lib/conquiro/search_api/client.rb', line 16

def strip_empty(params)
  params.select { |name, value| value.present? }
end