Class: Traktor::NML::File

Inherits:
Object
  • Object
show all
Defined in:
lib/traktor/nml/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ File

Returns a new instance of File.



10
11
12
13
14
15
# File 'lib/traktor/nml/file.rb', line 10

def initialize(content)
  doc = Oga.parse_xml content

  @collection = Traktor::NML::Collection.new doc.xpath('NML/COLLECTION/ENTRY')
  @playlist   = Traktor::NML::Playlist.new doc.xpath('NML/PLAYLISTS'), @collection
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



8
9
10
# File 'lib/traktor/nml/file.rb', line 8

def collection
  @collection
end

#playlistObject (readonly)

Returns the value of attribute playlist.



8
9
10
# File 'lib/traktor/nml/file.rb', line 8

def playlist
  @playlist
end