Class: TentD::API::Router::ExtractParams

Inherits:
Object
  • Object
show all
Defined in:
lib/tentd/api/router/extract_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keysObject

Returns the value of attribute keys.



5
6
7
# File 'lib/tentd/api/router/extract_params.rb', line 5

def keys
  @keys
end

#patternObject

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