Class: PlaylistCreator
- Inherits:
-
Object
- Object
- PlaylistCreator
- Defined in:
- lib/playlist_creator.rb
Instance Method Summary collapse
-
#initialize(obj) ⇒ PlaylistCreator
constructor
A new instance of PlaylistCreator.
- #to_xspf ⇒ Object
Constructor Details
#initialize(obj) ⇒ PlaylistCreator
Returns a new instance of PlaylistCreator.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/playlist_creator.rb', line 38 def initialize(obj) @dx = if obj.is_a? String then header = "<?dynarex schema='tracklist/track(title, location)'?>\n--+\n" Dynarex.new(header + obj) elsif obj.is_a? Dynarex obj end end |
Instance Method Details
#to_xspf ⇒ Object
49 50 51 52 53 |
# File 'lib/playlist_creator.rb', line 49 def to_xspf() doc = Nokogiri::XML(@dx.to_xml(pretty: true)) xslt = Nokogiri::XSLT(XSLT_DX) xslt.transform(doc).to_xml end |