1
0
Fork 0
musicbrainz/lib/musicbrainz/bindings/track.rb

18 lines
452 B
Ruby
Raw Normal View History

# -*- encoding : utf-8 -*-
2012-10-12 12:45:51 +00:00
module MusicBrainz
module Bindings
module Track
def parse(xml)
{
position: (xml.xpath('./position').text rescue nil),
recording_id: (xml.xpath('./recording').attribute('id').value rescue nil),
title: (xml.xpath('./recording/title').text rescue nil),
length: (xml.xpath('./recording/length').text rescue nil)
}
end
extend self
end
end
end