Class: TentClient::Middleware::AcceptHeader
- Inherits:
-
Object
- Object
- TentClient::Middleware::AcceptHeader
- Defined in:
- lib/tent-client/middleware/accept_header.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ AcceptHeader
constructor
A new instance of AcceptHeader.
Constructor Details
#initialize(app) ⇒ AcceptHeader
Returns a new instance of AcceptHeader.
4 5 6 |
# File 'lib/tent-client/middleware/accept_header.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 |
# File 'lib/tent-client/middleware/accept_header.rb', line 8 def call(env) env[:request_headers]['Accept'] ||= MEDIA_TYPE @app.call(env) end |