Class: Otto::RouteHandlers::BaseHandler
- Inherits:
-
Object
- Object
- Otto::RouteHandlers::BaseHandler
- Defined in:
- lib/otto/route_handlers.rb
Overview
Base class for all route handlers Provides common functionality and interface
Direct Known Subclasses
ClassMethodHandler, InstanceMethodHandler, LambdaHandler, LogicClassHandler
Instance Attribute Summary collapse
-
#otto_instance ⇒ Object
readonly
Returns the value of attribute otto_instance.
-
#route_definition ⇒ Object
readonly
Returns the value of attribute route_definition.
Instance Method Summary collapse
-
#call(env, extra_params = {}) ⇒ Array
Execute the route handler.
-
#initialize(route_definition, otto_instance = nil) ⇒ BaseHandler
constructor
A new instance of BaseHandler.
Constructor Details
#initialize(route_definition, otto_instance = nil) ⇒ BaseHandler
Returns a new instance of BaseHandler.
33 34 35 36 |
# File 'lib/otto/route_handlers.rb', line 33 def initialize(route_definition, otto_instance = nil) @route_definition = route_definition @otto_instance = otto_instance end |
Instance Attribute Details
#otto_instance ⇒ Object (readonly)
Returns the value of attribute otto_instance.
31 32 33 |
# File 'lib/otto/route_handlers.rb', line 31 def otto_instance @otto_instance end |
#route_definition ⇒ Object (readonly)
Returns the value of attribute route_definition.
31 32 33 |
# File 'lib/otto/route_handlers.rb', line 31 def route_definition @route_definition end |
Instance Method Details
#call(env, extra_params = {}) ⇒ Array
Execute the route handler
42 43 44 |
# File 'lib/otto/route_handlers.rb', line 42 def call(env, extra_params = {}) raise NotImplementedError, "Subclasses must implement #call" end |