Class: MPD::Playlist
- Inherits:
-
Array
- Object
- Array
- MPD::Playlist
- Defined in:
- lib/mpd/playlist.rb
Overview
Array<SongInfo> with some useful methods
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Playlist
constructor
data - array of hashes from MPD.
Constructor Details
Class Method Details
.from_response(response) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/mpd/playlist.rb', line 6 def self.from_response(response) data = [{}] response.key_value_pairs.each do |k, v| data.push({}) if data.last.key?(k) # next song reached data.last[k] = v end new(data) end |