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


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

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

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

  mount(configuration)
  middleware(environment)
  builder.run(routes)
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


40
41
42
# File 'lib/hanami/app.rb', line 40

def call(env)
  builder.call(env)
end