Class: Hanami::App

Inherits:
Slice
  • Object
show all
Defined in:
lib/hanami/app.rb

Overview

The Hanami app is a singular slice tasked with managing the core components of the app and coordinating overall app boot.

For smaller apps, the app may be the only slice present, whereas larger apps may consist of many slices, with the app reserved for holding a small number of shared components only.

See Also:

Since:

  • 2.0.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/hanami/app.rb', line 22

def self.inherited(subclass)
  super

  Hanami.app = subclass

  subclass.extend(ClassMethods)

  @_mutex.synchronize do
    subclass.class_eval do
      @config = Hanami::Config.new(app_name: slice_name, env: Hanami.env)
      Hanami::Env.load
    end
  end
end