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

20 lines
606 B
Ruby

# -*- encoding : utf-8 -*-
module MusicBrainz
module Bindings
module ReleaseGroup
def parse(xml)
xml = xml.xpath('./release-group') unless xml.xpath('./release-group').empty?
{
id: (xml.attribute('id').value rescue nil),
type: (xml.attribute('type').value rescue nil),
title: (xml.xpath('./title').text rescue nil),
desc: (xml.xpath('./disambiguation').text rescue nil),
first_release_date: (xml.xpath('./first-release-date').text rescue nil)
}.merge(Relations.parse(xml))
end
extend self
end
end
end