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



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

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

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



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

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



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

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

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



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

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

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



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

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