class Lyricit::LyricsApi

Public Class Methods

new(song_artist, song_name) click to toggle source
# File lib/lyricit/lyrics_api.rb, line 4
def initialize song_artist, song_name
    @song = song_name
    @artist = song_artist
end

Public Instance Methods

get_lyrics() click to toggle source
# File lib/lyricit/lyrics_api.rb, line 9
def get_lyrics
    try_make_it_personal_api
end
try_make_it_personal_api() click to toggle source
# File lib/lyricit/lyrics_api.rb, line 13
def try_make_it_personal_api
    lyrics = Lyricit::MakeItPersonal.get_lyrics @song, @artist

    case lyrics
    when nil
        puts "Something seems to be wrong with the API. Try after some time."
        return nil
    when :not_found
        puts "Sorry could not find the lyrics for the requested song."
        return nil
    when :incomplete_info
        puts "Either Artist or Song Title seems to be incorrect!"
        return nil
    else
        return lyrics
    end
end