If an object defines encode_with
, then an instance of Psych::Coder will be passed to the method when the
object is being serialized. The Coder
automatically assumes a Psych::Nodes::Mapping is being emitted.
Other objects like Sequence and Scalar may be emitted if seq=
or scalar=
are called, respectively.
Methods
- #
- A
- M
- N
- R
- S
Attributes
[RW] | implicit | |
[RW] | object | |
[R] | seq | |
[RW] | style | |
[RW] | tag | |
[R] | type |
Class Public methods
new(tag)
Link
Instance Public methods
[](k)
Link
map(tag = @tag, style = @style)
Link
Emit a map. The coder will be yielded to the block.
map=(map)
Link
Emit a map with value
represent_map(tag, map)
Link
Emit a sequence with map
and tag
represent_object(tag, obj)
Link
Emit an arbitrary object obj
and tag
represent_scalar(tag, value)
Link
Emit a scalar with value
and tag
represent_seq(tag, list)
Link
Emit a sequence with list
and tag
scalar(*args)
Link
scalar=(value)
Link
Emit a scalar with value