123456789_123456789_123456789_123456789_123456789_

Class: Psych::Emitter

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Psych::Stream::Emitter, Psych::JSON::Stream::Emitter
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Handler
Instance Chain:
self, Handler
Inherits: Psych::Handler
Defined in: ext/psych/psych_emitter.c

Constant Summary

Handler - Inherited

EVENTS, OPTIONS

Class Method Summary

Instance Attribute Summary

Handler - Inherited

#streaming?

Is this handler a streaming handler?

Instance Method Summary

Handler - Inherited

#alias

Called when an alias is found to anchor.

#empty

Called when an empty event happens.

#end_document

Called with the document ends.

#end_mapping

Called when a map ends.

#end_sequence

Called when a sequence ends.

#end_stream

Called when the YAML stream ends.

#scalar

Called when a scalar value is found.

#start_document

Called when the document starts with the declared version, tag_directives, if the document is implicit.

#start_mapping

Called when a map starts.

#start_sequence

Called when a sequence is started.

#start_stream

Called with encoding when the YAML stream starts.

Constructor Details

.new(io, options = Psych::Emitter::OPTIONS)

Create a new Emitter that writes to io.

Instance Attribute Details

#canonical (rw)

Get the output style, canonical or not.

#canonical=(true) (rw)

Set the output style to canonical, or not.

#indentation (rw)

Get the indentation level.

#indentation=(level) (rw)

Set the indentation level to level. The level must be less than 10 and greater than 1.

#line_width (rw)

Get the preferred line width.

#line_width=(width) (rw)

Set the preferred line with to width.

Instance Method Details

#alias(anchor)

Emit an alias with anchor.

See Handler#alias

#end_document(implicit)

End a document emission with an implicit ending.

See Handler#end_document

#end_mapping

Emit the end of a mapping.

See Handler#end_mapping

#end_sequence

End sequence emission.

See Handler#end_sequence

#end_stream

End a stream emission

See Handler#end_stream

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

Emit a scalar with value, anchor, tag, and a plain or quoted string type with style.

See Handler#scalar

#start_document(version, tags, implicit)

Start a document emission with YAML version, tags, and an implicit start.

See Handler#start_document

#start_mapping(anchor, tag, implicit, style)

Start emitting a YAML map with anchor, tag, an implicit start and end, and style.

See Handler#start_mapping

#start_sequence(anchor, tag, implicit, style)

Start emitting a sequence with anchor, a tag, implicit sequence start and end, along with style.

See Handler#start_sequence

#start_stream(encoding)

Start a stream emission with encoding

See Handler#start_stream