Class: Hibana::Application
- Inherits:
-
Object
- Object
- Hibana::Application
- Defined in:
- lib/hibana/application.rb
Class Attribute Summary collapse
Class Method Summary collapse
- .call(env) ⇒ Array
- .middleware ⇒ Object
-
.route(&block) ⇒ Object
Set routes using hanami-router DSL.
Instance Method Summary collapse
Class Attribute Details
.router ⇒ Hibana::Router?
8 9 10 |
# File 'lib/hibana/application.rb', line 8 def router @router end |
Class Method Details
.call(env) ⇒ Array
12 13 14 |
# File 'lib/hibana/application.rb', line 12 def call(env) rack_application.call(env) end |
.middleware ⇒ Object
21 22 23 |
# File 'lib/hibana/application.rb', line 21 def middleware @middleware ||= ::Rack::Builder.new end |
.route(&block) ⇒ Object
Set routes using hanami-router DSL.
17 18 19 |
# File 'lib/hibana/application.rb', line 17 def route(&block) self.router = ::Hanami::Router.new(&block) end |
Instance Method Details
#call(env) ⇒ Array
37 38 39 40 41 42 43 |
# File 'lib/hibana/application.rb', line 37 def call(env) unless self.class.router raise ::Hibana::Errors::RouterNotSetError end self.class.router.call(env) end |