diff options
Diffstat (limited to 'ext/psych/lib/psych/json/stream.rb')
-rw-r--r-- | ext/psych/lib/psych/json/stream.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/json/stream.rb b/ext/psych/lib/psych/json/stream.rb index a6da584cbf..b240b6cbdb 100644 --- a/ext/psych/lib/psych/json/stream.rb +++ b/ext/psych/lib/psych/json/stream.rb @@ -23,8 +23,17 @@ module Psych end end + def visit_Time o + formatted = format_time o + @emitter.scalar formatted, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED + end + + def visit_DateTime o + visit_Time o.to_time + end + def visit_String o - @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::ANY + @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED end alias :visit_Symbol :visit_String end |