class MultimediaParadise::LyricsFetcher
Constants
- SEARCH_TERM
#¶ ↑
SEARCH_TERM
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
feedback_available_titles()
click to toggle source
#¶ ↑
feedback_available_titles
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/audio/lyrics_fetcher.rb, line 210 def feedback_available_titles _ = obtain_raw_dataset if _.is_a? Hash counter = 0 cliner _.each_pair {|title, value| counter += 1 e; e '('+counter.to_s.rjust(2)+') '+simp(title) e; e value; e cliner } end end
fetch_subsections_from_dataset()
click to toggle source
lyrics?()
click to toggle source
main_file?()
click to toggle source
obtain_raw_dataset()
click to toggle source
#¶ ↑
obtain_raw_dataset
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/audio/lyrics_fetcher.rb, line 91 def obtain_raw_dataset @hash[:raw_dataset] = nil begin @hash[:raw_dataset] = YAML.load_file(main_file?) rescue Exception => e pp e end end
Also aliased as: raw_dataset?, load_yaml_dataset
open_yaml_file_in_editor()
click to toggle source
report(this = @hash[:text])
click to toggle source
#¶ ↑
report¶ ↑
#¶ ↑
# File lib/multimedia_paradise/audio/lyrics_fetcher.rb, line 175 def report(this = @hash[:text]) # ======================================================================= # # Ok, we found it, so display it next: # ======================================================================= # cliner colour: :konsole_slateblue e this cliner colour: :konsole_slateblue end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
MultimediaParadise::Base#reset
# File lib/multimedia_paradise/audio/lyrics_fetcher.rb, line 46 def reset super() # ======================================================================= # # === @hash # ======================================================================= # @hash = {} infer_the_namespace end
run()
click to toggle source
set_search_term(i = SEARCH_TERM)
click to toggle source
show_file_path()
click to toggle source
show_help()
click to toggle source
try_to_find_this_title(i)
click to toggle source
#¶ ↑
try_to_find_this_title
¶ ↑
This method will try to find an appropriate title.
#¶ ↑
# File lib/multimedia_paradise/audio/lyrics_fetcher.rb, line 157 def try_to_find_this_title(i) _ = raw_dataset? keys = _.keys.map possible_matches = keys.select {|entry| entry = entry.dup if entry.frozen? entry.downcase.include? i.downcase } if possible_matches.empty? opnn; e 'Did not find that particular key.' else @hash[:text] = _[possible_matches.first] report(@hash[:text]) end end