Class: Hanami::App Private

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

Overview

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

Main application that mounts many Rack and/or Hanami applications.

See Also:

Since:

  • 0.9.0

Instance Method Summary collapse

Constructor Details

#initialize(configuration, environment) ⇒ App

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.

Initialize a new instance

Parameters:

Since:

  • 0.9.0



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

def initialize(configuration, environment)
  Components.resolve('apps')

  @builder = Rack::Builder.new
  @routes  = Hanami::Router.new

  mount(configuration)
  middleware(configuration, environment)
  builder.run(routes)

  @app = builder.to_app
end

Instance Method Details

#call(env) ⇒ Array

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.

Implements Rack SPEC

Parameters:

  • env (Hash)

    a Rack env

Returns:

  • (Array)

    a serialized Rack response

Since:

  • 0.9.0



43
44
45
# File 'lib/hanami/app.rb', line 43

def call(env)
  app.call(env)
end