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



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

def visit_DateTime o
  visit_Time o.to_time
end

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



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

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

#visit_Time(o) ⇒ Object



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

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