1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/lib/mpd_client/queue.rb
2013-12-12 11:52:00 +00:00

29 lines
334 B
Ruby

module MPDClient
class Queue
include Enumerable
include Jsonable
attr :songs
def initialize
@songs = fetch_songs
end
def each(&block)
songs.each(&block)
end
def to_h
map(&:to_h)
end
private
def fetch_songs
MPDClient.conn.queue.map(&Song)
end
end
end