Class: Goliath::Chimp::Rack::ForceContentType
- Inherits:
-
Object
- Object
- Goliath::Chimp::Rack::ForceContentType
- Defined in:
- lib/goliath/chimp/rack/force_content_type.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, content_type) ⇒ ForceContentType
constructor
A new instance of ForceContentType.
Constructor Details
#initialize(app, content_type) ⇒ ForceContentType
Returns a new instance of ForceContentType.
7 8 9 |
# File 'lib/goliath/chimp/rack/force_content_type.rb', line 7 def initialize(app, content_type) @app = app ; @content_type = content_type end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/goliath/chimp/rack/force_content_type.rb', line 5 def content_type @content_type end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 |
# File 'lib/goliath/chimp/rack/force_content_type.rb', line 11 def call env env['CONTENT_TYPE'] = env['HTTP_ACCEPT'] = content_type @app.call env end |