Class: SetEntity
- Inherits:
-
Object
- Object
- SetEntity
- Defined in:
- lib/tentd-admin/set_entity.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ SetEntity
constructor
A new instance of SetEntity.
Constructor Details
#initialize(app) ⇒ SetEntity
Returns a new instance of SetEntity.
2 3 4 |
# File 'lib/tentd-admin/set_entity.rb', line 2 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
6 7 8 9 |
# File 'lib/tentd-admin/set_entity.rb', line 6 def call(env) env['tent.entity'] = (env['HTTP_X_FORWARDED_PROTO'] || env['rack.url_scheme']) + '://' + env['HTTP_HOST'] @app.call(env) end |