Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created June 18, 2010 03:58
Show Gist options
  • Save eqdw/443216 to your computer and use it in GitHub Desktop.
Save eqdw/443216 to your computer and use it in GitHub Desktop.
def to_xml
rtn = "<task>"
instance_variables.each do |i|
rtn += "<#{i[1..-1]}>#{instance_variable_get(i)}</#{i[1..-1]}>"
end
rtn += "</task>"
rtn
#"<task><id>#{@id}</id><name>#{@name}</name><desc>#{@desc}</desc><priority>#{@priority}</priority></task>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment