Class: Rack::AcceptDefault
- Inherits:
-
Object
- Object
- Rack::AcceptDefault
- Defined in:
- lib/rack/accept_default.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, default = '*/*') ⇒ AcceptDefault
constructor
A new instance of AcceptDefault.
Constructor Details
#initialize(app, default = '*/*') ⇒ AcceptDefault
Returns a new instance of AcceptDefault.
3 4 5 6 |
# File 'lib/rack/accept_default.rb', line 3 def initialize(app, default='*/*') @app = app @default = default end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 |
# File 'lib/rack/accept_default.rb', line 8 def call(env) env['HTTP_ACCEPT'] ||= @default @app.call(env) end |