class Matterhorn::Smil
Matterhorn::Smil
===¶ ↑
Attributes
body[R]
——————————————————————————- attributes —
head[R]
——————————————————————————- attributes —
Public Class Methods
new()
click to toggle source
————————————————————————— initialization —
# File lib/matterhorn/smil.rb, line 21 def initialize() @head = Smil::Head.new @body = Smil::Body.new end
Public Instance Methods
save(smil_file)
click to toggle source
——————————————————————————— methodes —
# File lib/matterhorn/smil.rb, line 29 def save(smil_file) File.open(smil_file, 'w') do |file| file.write(self.to_xml) end Rails.logger.debug { "Matterhorn::Smil::save | Smil description =\n#{self.to_xml}" } true end
to_xml()
click to toggle source
# File lib/matterhorn/smil.rb, line 38 def to_xml doc = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |bx| bx.smil('xmlns' => "http://www.w3.org/ns/SMIL", 'version' => '3.0') do head.to_xml(bx) body.to_xml(bx) end end doc.to_xml.sub(/version=\"1.0\"/, "version=\"1.1\"") end