Class: Psych::JSON::TreeBuilder
- Inherits:
-
TreeBuilder
- Object
- Handler
- TreeBuilder
- Psych::JSON::TreeBuilder
- Defined in:
- lib/psych/json/tree_builder.rb
Overview
Psych::JSON::TreeBuilder is an event based AST builder. Events are sent to an instance of Psych::JSON::TreeBuilder and a JSON AST is constructed.
Instance Attribute Summary
Attributes inherited from TreeBuilder
Instance Method Summary collapse
- #end_document(implicit_end = !streaming?) ⇒ Object
- #scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
- #start_document(version, tag_directives, implicit) ⇒ Object
- #start_mapping(anchor, tag, implicit, style) ⇒ Object
- #start_sequence(anchor, tag, implicit, style) ⇒ Object
Methods inherited from TreeBuilder
#alias, #end_stream, #initialize, #start_stream
Methods inherited from Handler
#alias, #empty, #end_mapping, #end_sequence, #end_stream, #start_stream, #streaming?
Constructor Details
This class inherits a constructor from Psych::TreeBuilder
Instance Method Details
#end_document(implicit_end = !streaming?) ⇒ Object
11 12 13 |
# File 'lib/psych/json/tree_builder.rb', line 11 def end_document implicit_end = !streaming? super(implicit_end) end |
#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/psych/json/tree_builder.rb', line 23 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
7 8 9 |
# File 'lib/psych/json/tree_builder.rb', line 7 def start_document version, tag_directives, implicit super(version, tag_directives, !streaming?) end |