class Movie::ConfigBuilder

Overview

ConfigBuilder provides a fluent API for building Config instances.

Example: config = Movie::Config.builder .set("name", "my-system") .set("remoting.host", "127.0.0.1") .set("remoting.port", 9000) .set("remoting.enabled", true) .build

Defined in:

movie/config.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def build : Config #

Builds the final Config instance.


[View source]
def merge(config : Config) : self #

Merges another config's values into this builder.


[View source]
def set(path : String, value : String) : self #

Sets a value at the given path. Paths can be nested using dots: "remoting.port"


[View source]
def set(path : String, value : Int32) : self #

[View source]
def set(path : String, value : Int64) : self #

[View source]
def set(path : String, value : Float64) : self #

[View source]
def set(path : String, value : Bool) : self #

[View source]
def set(path : String, value : Array(String)) : self #

[View source]
def set(path : String, value : Array(Int32)) : self #

[View source]
def set_duration(path : String, value : Time::Span) : self #

Sets a duration value (stored as string for serialization).


[View source]