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



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

def initialize
  Mutex.new.synchronize do
    assert_configuration_presence!
    @routes = Router.new(&@@configuration)
  end
end

Instance Attribute Details

#routesObject (readonly)

Since:

  • 0.1.0



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

def routes
  @routes
end

Class Method Details

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

Since:

  • 0.1.0



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

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



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

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