Module: Hanami::API::DSL::InstanceMethods
- Defined in:
- lib/hanami/api/dsl.rb
Overview
Instance Method Summary collapse
-
#call(env) ⇒ Object
Compatibility with Rack protocol.
- #freeze ⇒ Object private
-
#initialize(router: self.class.router.dup) ⇒ Object
Initialize the app.
-
#to_inspect ⇒ String
Printable routes.
Instance Method Details
#call(env) ⇒ Object
Compatibility with Rack protocol
120 121 122 |
# File 'lib/hanami/api/dsl.rb', line 120 def call(env) @app.call(env) end |
#freeze ⇒ 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.
104 105 106 107 108 109 110 111 112 |
# File 'lib/hanami/api/dsl.rb', line 104 def freeze @app = @router.to_rack_app @url_helpers = @router.url_helpers @router.remove_instance_variable(:@url_helpers) remove_instance_variable(:@router) @url_helpers.freeze @app.freeze super end |
#initialize(router: self.class.router.dup) ⇒ Object
Initialize the app
96 97 98 99 100 |
# File 'lib/hanami/api/dsl.rb', line 96 def initialize(router: self.class.router.dup) @router = router freeze end |
#to_inspect ⇒ String
Printable routes
130 131 132 |
# File 'lib/hanami/api/dsl.rb', line 130 def to_inspect @app.to_inspect end |