module GuitarpartyClient::Songs

Public Instance Methods

lyrics_by_id(id) click to toggle source
# File lib/guitarparty_client/songs.rb, line 20
def lyrics_by_id(id)
    response = RestClient.get "#{@base_url}/songs/#{id}/", {'Guitarparty-Api-Key' => @api_key}
    JSON.parse(response)["body"]
end
lyrics_by_name(name) click to toggle source
# File lib/guitarparty_client/songs.rb, line 15
def lyrics_by_name(name)
    response = RestClient.get "#{@base_url}songs/?query=#{name}", {'Guitarparty-Api-Key' => @api_key}
    JSON.parse(response)["objects"][0]["body"]
end
song_by_id(id) click to toggle source
# File lib/guitarparty_client/songs.rb, line 11
def song_by_id(id)
    RestClient.get "#{@base_url}songs/#{id}/", {'Guitarparty-Api-Key' => @api_key}
end
song_by_name(name) click to toggle source
# File lib/guitarparty_client/songs.rb, line 7
def song_by_name(name)
    RestClient.get "#{@base_url}songs/?query=#{name}", {'Guitarparty-Api-Key' => @api_key}
end