lib/itunes_parser/track.rb in itunes_parser-1.1.1 vs lib/itunes_parser/track.rb in itunes_parser-1.1.2
- old
+ new
@@ -3,11 +3,11 @@
# Shows all tracks in the doc.
# Returns Hash { track_id => { <track_information> } }
# Optional param `pretty` returns Array of Hashes with only IDs and Names.
def tracks pretty: false
- _tracks = doc["Tracks"]
+ _tracks = self.doc["Tracks"]
unless pretty
_tracks
else
_tracks.collect{|track| { id: track[1]["Track ID"], name: track[1]["Name"] }}
@@ -15,9 +15,9 @@
end
# Shows one track.
# Returns Hash with track info.
def track(id)
- tracks.select{|pl| pl["#{id}"] }.first[1]
+ tracks["#{id}"]
end
end
end