123456789_123456789_123456789_123456789_123456789_

Class: XMLRPC::XMLWriter::Simple

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Abstract
Instance Chain:
self, Abstract
Inherits: XMLRPC::XMLWriter::Abstract
Defined in: lib/xmlrpc/create.rb

Instance Method Summary

Instance Method Details

#document(*params)

[ GitHub ]

  
# File 'lib/xmlrpc/create.rb', line 31

def document(*params)
  params.join("")
end

#document_to_str(doc)

[ GitHub ]

  
# File 'lib/xmlrpc/create.rb', line 27

def document_to_str(doc)
  doc
end

#element(name, attrs, *children)

[ GitHub ]

  
# File 'lib/xmlrpc/create.rb', line 39

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)

[ GitHub ]

  
# File 'lib/xmlrpc/create.rb', line 35

def pi(name, *params)
  "<?#{name} " + params.join(" ") + " ?>"
end

#text(txt)

[ GitHub ]

  
# File 'lib/xmlrpc/create.rb', line 48

def text(txt)
  cleaned = txt.dup
  cleaned.gsub!(/&/, '&amp;')
  cleaned.gsub!(/</, '&lt;')
  cleaned.gsub!(/>/, '&gt;')
  cleaned
end