Class: Clarion::App

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/clarion/app.rb

Constant Summary collapse

CONTEXT_RACK_ENV_NAME =
'clarion.ctx'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize_context(config) ⇒ Object



17
18
19
20
21
# File 'lib/clarion/app.rb', line 17

def self.initialize_context(config)
  {
    config: config,
  }
end

.rack(config = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/clarion/app.rb', line 23

def self.rack(config={})
  klass = App

  context = initialize_context(config)
  lambda { |env|
    env[CONTEXT_RACK_ENV_NAME] = context
    klass.call(env)
  }
end

Instance Method Details

#/Object

UI



90
91
92
93
# File 'lib/clarion/app.rb', line 90

get '/' do
  content_type :text
  "Clarion\n"
end