class MultimediaParadise::PlayFromThisList
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
commandline_arguments?()
click to toggle source
determine_from_which_list_to_play()
click to toggle source
#¶ ↑
determine_from_which_list_to_play
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/multimedia/play_from_this_list.rb, line 77 def determine_from_which_list_to_play first = @commandline_arguments.first if first if first.is_a? String # =================================================================== # # In this case assume the user did input a list. # =================================================================== # @dataset = first elsif File.exist? first @dataset = File.readlines(first) end try_to_sanitize_the_dataset end end
play_the_files_in_the_dataset()
click to toggle source
#¶ ↑
play_the_files_in_the_dataset
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/multimedia/play_from_this_list.rb, line 117 def play_the_files_in_the_dataset if @dataset.nil? or @dataset.empty? opnn; e 'No valid input has been given to this class.' else @dataset.each {|entry| play_this_file(entry) } end end
play_this_file(i)
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
MultimediaParadise::Base#reset
# File lib/multimedia_paradise/multimedia/play_from_this_list.rb, line 47 def reset super() # ======================================================================= # # === @namespace # ======================================================================= # @namespace = NAMESPACE # ======================================================================= # # === @dataset # ======================================================================= # @dataset = nil end
run()
click to toggle source
set_commandline_arguments(i = '')
click to toggle source
try_to_sanitize_the_dataset()
click to toggle source
#¶ ↑
try_to_sanitize_the_dataset
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/multimedia/play_from_this_list.rb, line 95 def try_to_sanitize_the_dataset if @dataset.is_a? String @dataset = @dataset.split(N).reject {|line| line.strip.empty? } end # ======================================================================= # # Past this point we assume to only have an Array. Sanitize this # Array further: # ======================================================================= # @dataset.map! {|entry| entry.strip! if entry.start_with? '- ' entry[0,2] = '' end entry.strip } end