struct Athena::Config::Base

Overview

Base config type that wraps the Athena configuration file.

Components may add their own ACF::Configuration types to self to allow configuring that specific component.

# Define a custom configuration type.
# Additional configuration types may be nested.
struct SomeConfig
  include ACF::Configuration

  # Defines a required configuration property.
  # Optional properties can be made nilable or given a default value.
  getter api_key : String
end

# Reopen the base type to add our custom configuration type.
struct Athena::Config::Base
  getter some_config : SomeConfig
end

ACF::Base's YAML representation now looks like:

---
some_config:
  api_key: API_KEY

Included Modules

Defined in:

base.cr

Constructors

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

def self.new #

[View source]