Class: Steam::Connection::Static
- Inherits:
-
Rack::Static
- Object
- Rack::Static
- Steam::Connection::Static
- Defined in:
- lib/steam/connection/static.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(*args) ⇒ Static
constructor
A new instance of Static.
- #response_404 ⇒ Object
Constructor Details
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/steam/connection/static.rb', line 13 def call(env) status, headers, response = super response = case response when Rack::File Rack::Response.new(::File.read(response.path), status, headers).to_a when Array Rack::Response.new(response.first, status, headers).to_a else [status, headers, response] end response end |
#response_404 ⇒ Object
28 29 30 |
# File 'lib/steam/connection/static.rb', line 28 def response_404 Rack::Response.new('', 404).to_a end |