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
Class Method Summary
-
.new(io, options = Psych::Emitter::OPTIONS)
constructor
Create a new
Emitter
that writes toio
.
Instance Attribute Summary
-
#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
. -
#line_width
rw
Get the preferred line width.
-
#line_width=(width)
rw
Set the preferred line with to
width
.
Handler - Inherited
#streaming? | Is this handler a streaming handler? |
Instance Method Summary
-
#alias(anchor)
Emit an alias with
anchor
. -
#end_document(implicit)
End a document emission with an
implicit
ending. -
#end_mapping
Emit the end of a mapping.
-
#end_sequence
End sequence emission.
-
#end_stream
End a stream emission.
-
#scalar(value, anchor, tag, plain, quoted, style)
Emit a scalar with
value
,anchor
,tag
, and aplain
orquoted
string type withstyle
. -
#start_document(version, tags, implicit)
Start a document emission with YAML
version
,tags
, and animplicit
start. -
#start_mapping(anchor, tag, implicit, style)
Start emitting a YAML map with
anchor
,tag
, animplicit
start and end, andstyle
. -
#start_sequence(anchor, tag, implicit, style)
Start emitting a sequence with
anchor
, atag
,implicit
sequence start and end, along withstyle
. -
#start_stream(encoding)
Start a stream emission with
encoding
Handler - Inherited
#alias | Called when an alias is found to |
#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 |
#start_document | Called when the document starts with the declared |
#start_mapping | Called when a map starts. |
#start_sequence | Called when a sequence is started. |
#start_stream | Called with |
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.
#end_mapping
Emit the end of a mapping.
#end_sequence
End sequence emission.
#end_stream
End a stream emission
#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.
#start_mapping(anchor, tag, implicit, style)
Start emitting a YAML map with anchor
, tag
, an implicit
start and end, and style
.
#start_sequence(anchor, tag, implicit, style)
Start emitting a sequence with anchor
, a tag
, implicit
sequence start and end, along with style
.
#start_stream(encoding)
Start a stream emission with encoding