Class: Clarion::App
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Clarion::App
- Defined in:
- lib/clarion/app.rb
Constant Summary collapse
- CONTEXT_RACK_ENV_NAME =
'clarion.ctx'
Class Method Summary collapse
Instance Method Summary collapse
-
#/ ⇒ Object
UI.
Class Method Details
.initialize_context(config) ⇒ Object
18 19 20 21 22 |
# File 'lib/clarion/app.rb', line 18 def self.initialize_context(config) { config: config, } end |
.rack(config = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/clarion/app.rb', line 24 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
83 84 85 86 |
# File 'lib/clarion/app.rb', line 83 get '/' do content_type :text "Clarion\n" end |