Module: MusicBrainz::Bindings::Track

Extended by:
Track
Included in:
Track
Defined in:
lib/musicbrainz/bindings/track.rb

Instance Method Summary collapse

Instance Method Details

#parse(xml) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/musicbrainz/bindings/track.rb', line 5

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