Module: Psych::JSON::YAMLEvents

Included in:
Stream::Emitter, TreeBuilder
Defined in:
lib/psych/json/yaml_events.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#end_document(implicit_end = !streaming?) ⇒ Object



8
9
10
# File 'lib/psych/json/yaml_events.rb', line 8

def end_document implicit_end = !streaming?
  super(implicit_end)
end

#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/psych/json/yaml_events.rb', line 20

def scalar value, anchor, tag, plain, quoted, style
  if "tag:yaml.org,2002:null" == tag
    super('null', nil, nil, true, false, Nodes::Scalar::PLAIN)
  else
    super
  end
end

#start_document(version, tag_directives, implicit) ⇒ Object



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

def start_document version, tag_directives, implicit
  super(version, tag_directives, !streaming?)
end

#start_mapping(anchor, tag, implicit, style) ⇒ Object



12
13
14
# File 'lib/psych/json/yaml_events.rb', line 12

def start_mapping anchor, tag, implicit, style
  super(anchor, nil, true, Nodes::Mapping::FLOW)
end

#start_sequence(anchor, tag, implicit, style) ⇒ Object



16
17
18
# File 'lib/psych/json/yaml_events.rb', line 16

def start_sequence anchor, tag, implicit, style
  super(anchor, nil, true, Nodes::Sequence::FLOW)
end