abstract class Marten::Apps::Config

Overview

Base application config class.

This class can be subclassed on a per-application basis in order to configure the considered application. Things like the application label can be configured this way. Moreover, app config classes are also used in order to retrieve various abstractions associated with applications (such as models for example).

Included Modules

Direct Known Subclasses

Defined in:

marten/apps/config.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.label(label : String | Symbol) #

Allows to define the lable of the application config.


[View source]
def self.label : String #

Returns the label of the application config.


[View source]
def self.validate_label(label : String | Symbol) #

Validates the label of the application config.

Raises Marten::Apps::Errors::InvalidAppConfig if the label is invalid.


[View source]

Instance Method Detail

def ==(other : self) #

Returns true if the other app config corresponds to the current app config.


[View source]
def assets_finder #

Returns the assets finder of the application.

If the application doesn't have a dedicated assets directory, nil is returned.


[View source]
def label(*args, **options) #

[View source]
def label(*args, **options, &) #

[View source]
def main? #

Returns false in order to indicate that this is not the main application.


[View source]
def migrations_path #

Returns the migrations path for the application.


[View source]
def models : Array(Marten::DB::Model.class) #

[View source]
def register_model(model : DB::Model.class) #

Associates a model to the current app config.


[View source]
def setup #

Allows to perform additional setup operations for a given application.

Each application class can override this method in order to perform additional initializations and setup operations if needed. This method will be called during the Marten setup process when all the applications are known and initialized.


[View source]
def templates_loader #

Returns the templates loader of the application.

If the application doesn't have a dedicated templates directory, nil is returned.


[View source]
def translations_loader #

Returns the translations loader of the application.

If the application doesn't define translations in a dedicated directory, nil is returned.


[View source]