In Files

  • xmlrpc/create.rb

XMLRPC::XMLWriter::Simple

Public Instance Methods

document(*params) click to toggle source
 
               # File xmlrpc/create.rb, line 33
def document(*params)
  params.join("")
end
            
document_to_str(doc) click to toggle source
 
               # File xmlrpc/create.rb, line 29
def document_to_str(doc)
  doc
end
            
element(name, attrs, *children) click to toggle source
 
               # File xmlrpc/create.rb, line 41
def element(name, attrs, *children)
  raise "attributes not yet implemented" unless attrs.nil?
  if children.empty?
    "<#{name}/>" 
  else
    "<#{name}>" + children.join("") + "</#{name}>"
  end
end
            
pi(name, *params) click to toggle source
 
               # File xmlrpc/create.rb, line 37
def pi(name, *params)
  "<?#{name} " + params.join(" ") + " ?>"
end
            
text(txt) click to toggle source
 
               # File xmlrpc/create.rb, line 50
def text(txt)
  cleaned = txt.dup
  cleaned.gsub!(/&/, '&amp;')
  cleaned.gsub!(/</, '&lt;')
  cleaned.gsub!(/>/, '&gt;')
  cleaned
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus