[Nitro] Og fixtures for Time class

Humber Aquino humberaquino at gmail.com
Sat Dec 24 14:45:59 EST 2005


Hi TRANS!! Thanks a lot!
As you said, it's a mater of the YAML

This is a helpful cookbook for using yaml with ruby
http://yaml4r.sourceforge.net/cookbook/

Yaml recognize this pattern for the time:
iso8601: 2001-12-14t21:59:43.10-05:00
space seperated: 2001-12-14 21:59:43.10 -05:00

For example:

y = %q{
iso8601: 2001-12-14t21:59:43.10-05:00
space seperated: 2001-12-14 21:59:43.10 -05:00
}

YAML::load(y).each { |key, value| puts "'#{key}' => (#{value.class}) #{value}"}

# 'space seperated' => (Time) Fri Dec 14 23:59:43 PYST 2001
# 'iso8601' => (Time) Fri Dec 14 23:59:43 PYST 2001

Thanks again T. and mary christmas! :D

Humber




More information about the Nitro-general mailing list