X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/34d0bf15a6f4009de376ceed1d7d5cca24a8dfe7..f2ec7254120c90c3b023687f67a7b19f78b69370:/doc/Lyricli/Lyricli.html diff --git a/doc/Lyricli/Lyricli.html b/doc/Lyricli/Lyricli.html index 090262d..60c3a94 100644 --- a/doc/Lyricli/Lyricli.html +++ b/doc/Lyricli/Lyricli.html @@ -99,8 +99,21 @@
+

Overview

+
+

+This class has the basic logic for extracting the lyrics and controlling +the application +

+
+
+
+ + +
+ @@ -131,7 +144,10 @@ -
+

+Exits with error when there is an empty field from the current track. +

+
@@ -153,7 +169,11 @@ -
+

+Raises an InvalidLyricsException which means we did not get any valid +artist/song from any of the sources. +

+
@@ -161,7 +181,7 @@
  • - - (Object) get_lyrics + - (String) get_lyrics @@ -175,7 +195,11 @@ -
    +

    +Extracts the current track, validates it and requests the lyrics from our +LyricsEngine. +

    +
  • @@ -200,7 +224,7 @@

    -A new instance of Lyricli. +Constructor, initializes `@source_manager`.

    @@ -224,7 +248,11 @@ A new instance of Lyricli. -
    +

    +Set the `@current_track` instance variable by asking the SourceManager for +its current track. +

    +
    @@ -247,7 +275,7 @@ A new instance of Lyricli.

    -A new instance of Lyricli +Constructor, initializes `@source_manager`

    @@ -262,12 +290,12 @@ A new instance of Lyricli
     
     
    -4
    -5
    -6
    +8 +9 +10 -
    # File 'lib/lyricli/lyricli.rb', line 4
    +      
    # File 'lib/lyricli/lyricli.rb', line 8
     
     def initialize
       @source_manager = SourceManager.new
    @@ -293,19 +321,31 @@ A new instance of Lyricli
       
     
       
    -
    +
    +
    +

    +Exits with error when there is an empty field from the current track. +

    + + +
    +
    +
    + + +
    @@ -371,33 +421,65 @@ A new instance of Lyricli

    - - (Object) get_lyrics + - (String) get_lyrics -

     
     
    -29
    -30
    -31
    -32
    +44 +45 +46 +47
    -
    # File 'lib/lyricli/lyricli.rb', line 29
    +      
    # File 'lib/lyricli/lyricli.rb', line 44
     
     def check_params
       self.exit_with_error if @current_track[:artist].nil? or @current_track[:artist].empty?
    @@ -327,7 +367,11 @@ A new instance of Lyricli
       
     
    - +

    +Raises an InvalidLyricsException which means we did not get any valid +artist/song from any of the sources +

    +
    @@ -339,9 +383,15 @@ A new instance of Lyricli
  • - (InvalidLyrics) + (Lyricli::InvalidLyricsException) + + — +

    +because we found nothing +

    +
  • @@ -353,15 +403,15 @@ A new instance of Lyricli
     
     
    -8
    -9
    -10
    +16 +17 +18
    -
    # File 'lib/lyricli/lyricli.rb', line 8
    +      
    # File 'lib/lyricli/lyricli.rb', line 16
     
     def exit_with_error
    -  raise InvalidLyrics
    +  raise InvalidLyricsException
     end
    +
    +
    +

    +Extracts the current track, validates it and requests the lyrics from our +LyricsEngine +

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + + — +

      +the found lyrics, or a string indicating none were found +

      +
      + +
    • + +
    + +
     
     
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35
    -
    # File 'lib/lyricli/lyricli.rb', line 12
    +      
    # File 'lib/lyricli/lyricli.rb', line 24
     
     def get_lyrics
       set_current_track
    @@ -425,18 +507,31 @@ A new instance of Lyricli
       
     
       
    -
    +
    +
    +

    +Set the `@current_track` instance variable by asking the SourceManager for +its current track +

    + + +
    +
    +
    + + +
     
     
    -25
    -26
    -27
    +39 +40 +41
    -
    # File 'lib/lyricli/lyricli.rb', line 25
    +      
    # File 'lib/lyricli/lyricli.rb', line 39
     
     def set_current_track
       @current_track = @source_manager.current_track
    @@ -451,7 +546,7 @@ A new instance of Lyricli