Class: Hanami::Application
- Inherits:
-
Object
- Object
- Hanami::Application
- Defined in:
- lib/hanami/application.rb
Overview
A full stack Hanami application
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.inherited(base) ⇒ Object
private
Override Ruby’s Class#inherited.
Instance Method Summary collapse
-
#call(env) ⇒ Array
Process a request.
-
#initialize ⇒ Hanami::Application
constructor
private
Initialize and load a new instance of the application.
Constructor Details
#initialize ⇒ Hanami::Application
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize and load a new instance of the application
151 152 153 154 |
# File 'lib/hanami/application.rb', line 151 def initialize @renderer = RenderingPolicy.new(configuration) @middleware = configuration.middleware end |
Class Method Details
.inherited(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Override Ruby’s Class#inherited
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/hanami/application.rb', line 28 def self.inherited(base) super base.extend(ClassMethods) base.namespace.module_eval do class << self # Routes for this application # # @return [Hanami::Routes] the routes for this Hanami application # # @since 0.9.0 # @api public # # @example # # Web.routes # Admin.routes attr_accessor :routes end end end |
Instance Method Details
#call(env) ⇒ Array
Process a request. This method makes Hanami applications compatible with the Rack protocol.
168 169 170 |
# File 'lib/hanami/application.rb', line 168 def call(env) renderer.render(env, middleware.call(env)) end |