class MultimediaParadise::AudioBase

Constants

ERROR_LINE
#

ERROR_LINE

#

Public Class Methods

new() click to toggle source
#

initialize

#
# File lib/multimedia_paradise/audio/base.rb, line 32
def initialize
  reset
end

Public Instance Methods

directory_to_the_local_songs?() click to toggle source
#

directory_to_the_local_songs?

#
# File lib/multimedia_paradise/audio/base.rb, line 46
def directory_to_the_local_songs?
  DIRECTORY_TO_THE_LOCAL_SONGS
end
reset() click to toggle source
#

reset

#
# File lib/multimedia_paradise/audio/base.rb, line 39
def reset
  super()
end
return_random_audio_file( from_this_directory = '/home/x/songs/' ) click to toggle source
#

return_random_audio_file

This method can be used to return a random audio file from a given (local) directory.

#
# File lib/multimedia_paradise/audio/base.rb, line 56
def return_random_audio_file(
    from_this_directory = '/home/x/songs/'
  )
  if File.directory? from_this_directory.delete('*')
    _ = from_this_directory+'*'
    this_file = Dir[_].sample
    return this_file
  end
  return nil
end