Sha256: 03b4712d618059a31ba6c0d775909477e9e60ee3c6a802d0f80f23d89b8641e9

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 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)
        }
      end

      extend self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
musicbrainz-0.7.4 lib/musicbrainz/bindings/release_group.rb
musicbrainz-0.7.3 lib/musicbrainz/bindings/release_group.rb
musicbrainz-0.7.2 lib/musicbrainz/bindings/release_group.rb