class

Enkaidu::ConfigSerializable

Inherits JSON::Serializable < YAML::Serializable::Strict < YAML::Serializable < Reference < Object

Convenient serializable class that contains common functionality: automatic interpolation of env vars in String values. Currently supports config properties with values of type String, String?, Hash(String,String) and Array(String)

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(pull : JSON::PullParser)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

after_initialize

Support env var substitution for all instance vars with String values

Source

Macros

getter_with_presence(name, type)

This convenience macro intentionally doesn't use TypeDeclaration macro-level type node to work around an emaba bug: https://github.com/crystal-ameba/ameba/issues/447

Source
post_process_string_values

Use within #after_initialize method to map interpolate env vars in vars of following types: String, String?, Hash(String,String), Array(String)`

Source