Module: Hanami::Action::Rack::ClassMethods Private
- Defined in:
- lib/hanami/action/rack.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#params_class ⇒ Class
private
Returns the class which defines the params.
-
#rack_builder ⇒ Rack::Builder
private
Build rack builder.
-
#use(middleware, *args, &block) ⇒ Object
private
Use a Rack middleware.
Instance Method Details
#params_class ⇒ Class
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.
Returns the class which defines the params
Returns the class which has been provided to define the params. By default this will be Hanami::Action::Params.
159 160 161 |
# File 'lib/hanami/action/rack.rb', line 159 def params_class @params_class ||= BaseParams end |
#rack_builder ⇒ Rack::Builder
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.
Build rack builder
107 108 109 110 111 112 113 114 |
# File 'lib/hanami/action/rack.rb', line 107 def rack_builder @rack_builder ||= begin extend Hanami::Action::Rack::Callable rack_builder = ::Rack::Builder.new rack_builder.run ->(env) { self.new.call(env) } rack_builder end end |
#use(middleware, *args, &block) ⇒ 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.
Use a Rack middleware
The middleware will be used as it is.
At the runtime, the middleware be invoked with the raw Rack env.
Multiple middlewares can be employed, just by using multiple times this method.
145 146 147 |
# File 'lib/hanami/action/rack.rb', line 145 def use(middleware, *args, &block) rack_builder.use middleware, *args, &block end |