]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - lib/lyricli/lyrics_engine.rb
Adds skeletons for Exceptions
[rbdr/lyricli.rb] / lib / lyricli / lyrics_engine.rb
index 65e36dbf95d23786412225ee56a47f0f7f3509ec..beacd4610490d6c17af4dc94f9c035dff08fe027 100644 (file)
@@ -1,12 +1,21 @@
 module Lyricli
 module Lyricli
+
+  # This class gets the lyrics according to a given artist and song name.
   class LyricsEngine
 
     include Util
 
   class LyricsEngine
 
     include Util
 
+    # Starts a new instance of LyricsEngine
+    #
+    # @param [String] artist the artist
+    # @param [String] song the song to look for
     def initialize(artist, song)
       @provider = URI("http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson")
     end
 
     def initialize(artist, song)
       @provider = URI("http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson")
     end
 
+    # Asks Lyrics Wiki for the lyrics, also cleans up the output a little.
+    #
+    # @return [String] the lyrics
     def get_lyrics
       begin
         response = Net::HTTP.get(@provider)
     def get_lyrics
       begin
         response = Net::HTTP.get(@provider)
@@ -28,6 +37,5 @@ module Lyricli
 
       node.inner_text
     end
 
       node.inner_text
     end
-
   end
 end
   end
 end