Module: OfficialFM::Tracks
- Included in:
- Client
- Defined in:
- lib/officialfm/tracks.rb
Instance Method Summary collapse
-
#track(id, options = {}) ⇒ Object
Retrieve information about a specific track.
-
#tracks(search_param, options = {}) ⇒ Object
Search for tracks.
Instance Method Details
#track(id, options = {}) ⇒ Object
Retrieve information about a specific track
17 18 19 20 21 22 |
# File 'lib/officialfm/tracks.rb', line 17 def track(id, ={}) url = resource_url(id, parent: 'tracks') response = get url, response.body.track end |
#tracks(search_param, options = {}) ⇒ Object
Search for tracks
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/officialfm/tracks.rb', line 5 def tracks(search_param, ={}) response = get '/tracks/search', .merge(:q => search_param) response.body.tracks.map! do |t| # remove useless root t.track end response.body end |