Class: TentD::API::Router::ExtractParams
- Inherits:
-
Object
- Object
- TentD::API::Router::ExtractParams
- Defined in:
- lib/tentd/api/router/extract_params.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, pattern, keys) ⇒ ExtractParams
constructor
A new instance of ExtractParams.
Constructor Details
#initialize(app, pattern, keys) ⇒ ExtractParams
Returns a new instance of ExtractParams.
7 8 9 |
# File 'lib/tentd/api/router/extract_params.rb', line 7 def initialize(app, pattern, keys) @app, @pattern, @keys = app, pattern, keys end |
Instance Attribute Details
#keys ⇒ Object
Returns the value of attribute keys.
5 6 7 |
# File 'lib/tentd/api/router/extract_params.rb', line 5 def keys @keys end |
#pattern ⇒ Object
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/tentd/api/router/extract_params.rb', line 5 def pattern @pattern end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/tentd/api/router/extract_params.rb', line 11 def call(env) add_request(env) extract_params(env) env['tent.entity'] ||= ENV['TENT_ENTITY'] @app.call(env) end |