Class: Rack::Accepts
- Inherits:
-
Object
- Object
- Rack::Accepts
- Defined in:
- lib/rack/accepts/accepts.rb,
lib/rack/accepts/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Accepts
constructor
A new instance of Accepts.
Constructor Details
#initialize(app) ⇒ Accepts
Returns a new instance of Accepts.
3 4 5 |
# File 'lib/rack/accepts/accepts.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/rack/accepts/accepts.rb', line 7 def call(env) if some_bad_accepts_headers? Rack::Response.new([], 406).finish else @app.call(env) end end |