Module: Emmy::Backend

Extended by:
EmmyMachine::ClassMethods
Defined in:
lib/emmy/backend.rb

Class Method Summary collapse

Class Method Details

.app(name = nil, &b) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/emmy/backend.rb', line 8

def app(name=nil, &b)
  name ||= Emmy::Runner.instance.config.backend

  if b
    app = EmmyHttp::Application.new
    app.instance_eval(&b)
    apps(name, app)
  else
    apps(name)
  end
end

.apps(name, app = nil) ⇒ Object



20
21
22
23
# File 'lib/emmy/backend.rb', line 20

def apps(name, app=nil)
  @apps ||= {}
  app ? @apps[name || :default] = app : @apps[name || :default]
end

.to_aObject



25
26
27
# File 'lib/emmy/backend.rb', line 25

def to_a
  apps.to_a
end