class
Amber::Configuration::AppConfig
- Amber::Configuration::AppConfig
- Reference
- Object
Included Modules
- YAML::Serializable
Defined in:
amber/configuration/app_config.crConstructors
Instance Method Summary
-
#custom(key : Symbol, type : T.class) : T forall T
Retrieve a registered custom configuration section by key and type.
-
#custom_configs : Hash(String, String)
Custom configuration sections loaded at runtime, as the raw YAML of each section keyed by section name.
-
#custom_configs=(custom_configs : Hash(String, String))
Custom configuration sections loaded at runtime, as the raw YAML of each section keyed by section name.
- #database : DatabaseConfig
- #database=(database : DatabaseConfig)
- #jobs : JobsConfig
- #jobs=(jobs : JobsConfig)
- #logging : LoggingConfig
- #logging=(logging : LoggingConfig)
- #mailer : MailerConfig
- #mailer=(mailer : MailerConfig)
- #name : String
- #name=(name : String)
- #params : ParamsConfig
- #params=(params : ParamsConfig)
- #pubsub : PubSubConfig
- #pubsub=(pubsub : PubSubConfig)
- #secrets : Hash(String, String)
- #secrets=(secrets : Hash(String, String))
- #server : ServerConfig
- #server=(server : ServerConfig)
- #session : SessionConfig
- #session=(session : SessionConfig)
- #static : StaticConfig
- #static=(static : StaticConfig)
-
#validate!(environment : Amber::Environment::Env | Nil = nil) : Nil
Run validation on all subsystem configurations.
Constructor Detail
Instance Method Detail
Retrieve a registered custom configuration section by key and type.
Example
stripe = Amber.settings.custom(:stripe, MyApp::StripeConfig)
stripe.api_key # => "sk_test_..."
The section is deserialized as type on each call, so keep the result
rather than calling this per request. When the YAML has no such section,
the default instance given to Amber::Configuration.register is returned.
Custom configuration sections loaded at runtime, as the raw YAML of each
section keyed by section name. Storing YAML rather than
YAML::Serializable instances keeps Amber from deserializing through the
union of every YAML::Serializable type in the program; that union
includes application models (Grant models among them), and their YAML
constructors may not compile.
Custom configuration sections loaded at runtime, as the raw YAML of each
section keyed by section name. Storing YAML rather than
YAML::Serializable instances keeps Amber from deserializing through the
union of every YAML::Serializable type in the program; that union
includes application models (Grant models among them), and their YAML
constructors may not compile.
Run validation on all subsystem configurations. Collects all errors and raises a single ConfigurationError if any are found.