class TOML::Key

Overview

A possibly-dotted key, e.g. physical.shape or "a"."b".c. Stored as the ordered list of its parts plus the verbatim raw source text (including any whitespace around the dots), so the serializer can re-emit the key byte-for-byte.

Defined in:

toml/key.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(parts : Array(KeyPart), raw : String) #

[View source]

Instance Method Detail

def parts : Array(KeyPart) #

[View source]
def path : Array(String) #

The logical path of this key as an Array(String) (decoded).


[View source]
def raw : String #

[View source]
def to_s(io : IO) : Nil #

Convenience: shorthand for path.join('.'). Useful for error messages but not for storage — TOML keys with dots in them are legal and would round-trip incorrectly through this method.


[View source]