Module: Lotus::Action::Callable
- Defined in:
- lib/lotus/action/callable.rb
Overview
Instance Method Summary collapse
-
#call(env) ⇒ Array
Execute application logic.
Instance Method Details
#call(env) ⇒ Array
Execute application logic. It implements the Rack protocol.
The request params are passed as an argument to the ‘#call` method.
If routed with Lotus::Router, it extracts the relevant bits from the Rack ‘env` (eg the requested `:id`).
Otherwise everything it’s passed as it is: the full Rack ‘env` in production, and the given `Hash` for unit tests. See the examples below.
Application developers are forced to implement this method in their actions.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/lotus/action/callable.rb', line 68 def call(env) _rescue do @_env = env @headers = ::Rack::Utils::HeaderHash.new(configuration.default_headers) @params = self.class.params_class.new(@_env) super @params end finish end |