Class: AirPlayer::Playlist

Inherits:
Array
  • Object
show all
Defined in:
lib/airplayer/playlist.rb

Instance Method Summary collapse

Instance Method Details

#add(item) ⇒ Object



3
4
5
6
7
# File 'lib/airplayer/playlist.rb', line 3

def add(item)
  path = File.expand_path(item)
  Dir.exists?(path) ? concat(media_in(path)) : push(Media.new(item))
  self
end

#entries(repeat = false, &blk) ⇒ Object



9
10
11
12
13
14
# File 'lib/airplayer/playlist.rb', line 9

def entries(repeat = false, &blk)
  loop do
    send(:each, &blk)
    break unless repeat
  end
end