diff options
Diffstat (limited to 'ruby_1_9_3/ext/psych/lib/psych/json/ruby_events.rb')
-rw-r--r-- | ruby_1_9_3/ext/psych/lib/psych/json/ruby_events.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ruby_1_9_3/ext/psych/lib/psych/json/ruby_events.rb b/ruby_1_9_3/ext/psych/lib/psych/json/ruby_events.rb new file mode 100644 index 0000000000..6b73249c06 --- /dev/null +++ b/ruby_1_9_3/ext/psych/lib/psych/json/ruby_events.rb @@ -0,0 +1,19 @@ +module Psych + module JSON + module RubyEvents # :nodoc: + 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::DOUBLE_QUOTED + end + alias :visit_Symbol :visit_String + end + end +end |