Class: SpotTracks::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/spot_tracks/player.rb

Constant Summary collapse

HOST =
'https://api.spotify.com'

Instance Method Summary collapse

Instance Method Details

#search(term) ⇒ Object



8
9
10
11
# File 'lib/spot_tracks/player.rb', line 8

def search(term)
  path = "v1/search?q=#{CGI.escape(term)}&type=track"
  SpotTracks::Track.parse api_data("#{HOST}/#{path}")
end