提交 9f5ab945 编写于 作者: J Jeremy Kemper

Lazy-require XmlSimple. Move CGI require to object conversions where it's actually used.

上级 e9310122
require 'date'
require 'cgi'
require 'xmlsimple'
# Locked down XmlSimple#xml_in_string
class XmlSimple
......@@ -168,6 +166,8 @@ def to_xml(options = {})
module ClassMethods
def from_xml(xml)
require 'xmlsimple'
# TODO: Refactor this into something much cleaner that doesn't rely on XmlSimple
typecast_xml_value(undasherize_keys(XmlSimple.xml_in_string(xml,
'forcearray' => false,
......
require 'cgi'
class Object
# Alias of <tt>to_s</tt>.
def to_param
......@@ -11,4 +13,4 @@ def to_param
def to_query(key)
"#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
end
end
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册