Module: Psych::JSON::RubyEvents

Included in:
Stream, Visitors::JSONTree
Defined in:
lib/psych/json/ruby_events.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#visit_DateTime(o) ⇒ Object



9
10
11
# File 'lib/psych/json/ruby_events.rb', line 9

def visit_DateTime o
  visit_Time o.to_time
end

#visit_String(o) ⇒ Object Also known as: visit_Symbol



13
14
15
# File 'lib/psych/json/ruby_events.rb', line 13

def visit_String o
  @emitter.scalar o.to_s, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED
end

#visit_Time(o) ⇒ Object



4
5
6
7
# File 'lib/psych/json/ruby_events.rb', line 4

def visit_Time o
  formatted = format_time o
  @emitter.scalar formatted, nil, nil, false, true, Nodes::Scalar::DOUBLE_QUOTED
end