module KYAML::Scalar

Overview

Stateless rendering of KYAML scalar leaves and mapping keys, shared by the Emitter and Builder for consistency. Every method writes directly to io. indent is the callers current indentation level, used for multi-line flow-folded string layout.

Extended Modules

Defined in:

kyaml/scalar.cr

Instance Method Summary

Instance Method Detail

def float(io : IO, value : Float64) : Nil #

Renders value asa finite float.

Raises KYAML::Emitter on Ininity/NaN.


[View source]
def key(io : IO, key : String, indent : Int32 = 0) : Nil #

Renders key, quoting only when it is not a safe plain key.


[View source]
def safe_unquoted_key?(key : String) : Bool #

Returns true if key is safe to emit as a plain unquoted KYAML key.


[View source]
def string(io : IO, value : String, indent : Int32 = 0) : Nil #

Renders value as a doublequoted string. Multiline strings use YAML flow-folding.


[View source]
def write(io : IO, value : Nil, indent : Int32 = 0) : Nil #

Renders a scalar leaf (Nil, Bool, Int64, Float64, String)


[View source]
def write(io : IO, value : Bool, indent : Int32 = 0) : Nil #

Renders a scalar leaf (Nil, Bool, Int64, Float64, String)


[View source]
def write(io : IO, value : Int64, indent : Int32 = 0) : Nil #

Renders a scalar leaf (Nil, Bool, Int64, Float64, String)


[View source]
def write(io : IO, value : Float64, indent : Int32 = 0) : Nil #

Renders a scalar leaf (Nil, Bool, Int64, Float64, String)


[View source]
def write(io : IO, value : String, indent : Int32 = 0) : Nil #

Renders a scalar leaf (Nil, Bool, Int64, Float64, String)


[View source]