Class: XMLRPC::XMLWriter::Simple
- Defined in:
- lib/xmlrpc/create.rb
Instance Method Summary collapse
- #document(*params) ⇒ Object
- #document_to_str(doc) ⇒ Object
- #element(name, attrs, *children) ⇒ Object
- #pi(name, *params) ⇒ Object
- #text(txt) ⇒ Object
Methods inherited from Abstract
Instance Method Details
#document(*params) ⇒ Object
31 32 33 |
# File 'lib/xmlrpc/create.rb', line 31 def document(*params) params.join("") end |
#document_to_str(doc) ⇒ Object
27 28 29 |
# File 'lib/xmlrpc/create.rb', line 27 def document_to_str(doc) doc end |
#element(name, attrs, *children) ⇒ Object
39 40 41 42 43 44 45 46 |
# 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) ⇒ Object
35 36 37 |
# File 'lib/xmlrpc/create.rb', line 35 def pi(name, *params) "<?#{name} " + params.join(" ") + " ?>" end |
#text(txt) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/xmlrpc/create.rb', line 48 def text(txt) cleaned = txt.dup cleaned.gsub!(/&/, '&') cleaned.gsub!(/</, '<') cleaned.gsub!(/>/, '>') cleaned end |