Class: Hyperdrive::Middleware::Accept
- Inherits:
-
Object
- Object
- Hyperdrive::Middleware::Accept
- Defined in:
- lib/hyperdrive/middleware/accept.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Accept
constructor
A new instance of Accept.
Constructor Details
#initialize(app) ⇒ Accept
Returns a new instance of Accept.
6 7 8 |
# File 'lib/hyperdrive/middleware/accept.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 |
# File 'lib/hyperdrive/middleware/accept.rb', line 10 def call(env) env['hyperdrive.accept'] = Rack::Accept::MediaType.new(env['HTTP_ACCEPT']) @app.call(env) end |