class N42translation::XML

Public Class Methods

createXML(yaml) click to toggle source
# File lib/n42translation/xml.rb, line 7
def self.createXML(yaml)
  return yaml_to_xml(yaml)
end

Private Class Methods

yaml_to_xml(yaml) click to toggle source
# File lib/n42translation/xml.rb, line 12
def self.yaml_to_xml(yaml)
  xml = Builder::XmlMarkup.new( :indent => 2 )
  xml.instruct! :xml, :encoding => "utf-8"
  xml.resources do |r|
    yaml.each do |name, value|
      r.string("\"#{value}\"" ,:name => name)
    end
  end
  return xml
end