Sha256: c4b4b2adeb38adc9b9c608166fc17be5d686eb407ac89dce2857b5d45b657957

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
musicbrainz-0.8.0 lib/musicbrainz/bindings/release_group.rb
musicbrainz-0.7.7 lib/musicbrainz/bindings/release_group.rb
musicbrainz-0.7.6 lib/musicbrainz/bindings/release_group.rb