lib/apricoteatsgorilla/apricoteatsgorilla.rb in rubiii-apricoteatsgorilla-0.5.4 vs lib/apricoteatsgorilla/apricoteatsgorilla.rb in rubiii-apricoteatsgorilla-0.5.5
- old
+ new
@@ -241,12 +241,17 @@
end
# Converts XML values to more natural Ruby objects.
def map_xml_value(value)
case value
- when "true" then true
- when "false" then false
- else value
+ when /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/
+ DateTime.parse(value)
+ when "true"
+ true
+ when "false"
+ false
+ else
+ value
end
end
# Converts Hash values into valid XML values.
def map_hash_value(value)