Class: Adva::Static::Server::Static
- Inherits:
-
Rack::File
- Object
- Rack::File
- Adva::Static::Server::Static
- Defined in:
- lib/adva/static/server/static.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, root) ⇒ Static
constructor
A new instance of Static.
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/adva/static/server/static.rb', line 7 def app @app end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
7 8 9 |
# File 'lib/adva/static/server/static.rb', line 7 def root @root end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/adva/static/server/static.rb', line 15 def call(env) if get?(env) && path = static(env) super(env.merge('PATH_INFO' => path)) else app.call(env) end end |