Module: Siilar::Client::Search

Included in:
SearchService
Defined in:
lib/siilar/client/search.rb

Instance Method Summary collapse

Instance Method Details

#suggestions(query = {}) ⇒ Object

Search for a track from external ids



18
19
20
21
22
23
# File 'lib/siilar/client/search.rb', line 18

def suggestions(query = {})
  options = { query: query }
  response = client.get('2.0/suggestions', options)

  Struct::Suggestion.new(response)
end

#tracks(query = {}) ⇒ Object

Search for a track



8
9
10
11
12
13
# File 'lib/siilar/client/search.rb', line 8

def tracks(query = {})
  options = { query: query }
  response = client.get('2.0/tracks/search', options)

  response['data'].map { |r| Struct::Track.new(r) }
end