Module: AppleMusicLibrary::Utils

Included in:
Library
Defined in:
lib/apple_music_library/utils.rb

Instance Method Summary collapse

Instance Method Details

#delimit(number) ⇒ Object



20
21
22
# File 'lib/apple_music_library/utils.rb', line 20

def delimit(number)
  number.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
end

#dumpObject



24
25
26
# File 'lib/apple_music_library/utils.rb', line 24

def dump
  ap plist
end

#heading(text) ⇒ Object



13
14
15
16
17
18
# File 'lib/apple_music_library/utils.rb', line 13

def heading(text)
  puts
  puts "---------------------------------------------------------------------------"
  puts "#{text} [#{delimit(songs.size)} songs]"
  puts "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
end

#message(text) ⇒ Object



6
7
8
9
10
11
# File 'lib/apple_music_library/utils.rb', line 6

def message(text)
  return unless @verbose
  puts "---------------------------------------------------------------------------"
  puts "DEV MESSAGE @ #{Time.now.strftime('%H:%M:%S')} ::: #{text}"
  puts "---------------------------------------------------------------------------"
end