Class: Lotus::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/container.rb

Overview

Since:

  • 0.1.0

Defined Under Namespace

Classes: Router

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContainer

Returns a new instance of Container.

Since:

  • 0.1.0



29
30
31
32
33
34
# File 'lib/lotus/container.rb', line 29

def initialize
  Mutex.new.synchronize do
    assert_configuration_presence!
    prepare_middleware_stack!
  end
end

Instance Attribute Details

#routesObject (readonly)

Since:

  • 0.1.0



20
21
22
# File 'lib/lotus/container.rb', line 20

def routes
  @routes
end

Class Method Details

.configure(options = {}, &blk) ⇒ Object

Since:

  • 0.1.0



22
23
24
25
26
27
# File 'lib/lotus/container.rb', line 22

def self.configure(options = {}, &blk)
  Mutex.new.synchronize do
    @@options       = options
    @@configuration = blk
  end
end

Instance Method Details

#call(env) ⇒ Object

Since:

  • 0.1.0



36
37
38
# File 'lib/lotus/container.rb', line 36

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