Class: MusixMatch::InstantLyrics::Search
- Inherits:
-
Object
- Object
- MusixMatch::InstantLyrics::Search
- Defined in:
- lib/musix_match/instant_lyrics.rb
Class Method Summary collapse
Instance Method Summary collapse
- #find_lyrics(track_id) ⇒ Object
-
#initialize(q) ⇒ Search
constructor
A new instance of Search.
- #search_track ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(q) ⇒ Search
Returns a new instance of Search.
16 17 18 |
# File 'lib/musix_match/instant_lyrics.rb', line 16 def initialize(q) @q = q end |
Class Method Details
Instance Method Details
#find_lyrics(track_id) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/musix_match/instant_lyrics.rb', line 33 def find_lyrics(track_id) result = MusixMatch.get_lyrics(track_id) if result.status_code == 200 && lyrics = result.lyrics lyrics end end |
#search_track ⇒ Object
26 27 28 29 30 31 |
# File 'lib/musix_match/instant_lyrics.rb', line 26 def search_track result = MusixMatch.search_track(:q => @q, :f_has_lyrics => 1) if result.status_code == 200 && lyrics = result.track_list.first lyrics.track_id end end |