Class: Tres::Server
- Inherits:
-
Object
- Object
- Tres::Server
- Defined in:
- lib/tres/server.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Server
constructor
A new instance of Server.
- #to_rack_app ⇒ Object
Constructor Details
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
6 7 8 |
# File 'lib/tres/server.rb', line 6 def app @app end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/tres/server.rb', line 13 def call env response = serve_static env response = serve_asset env if not_found?(response) response = serve_index if not_found?(response) response end |
#to_rack_app ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/tres/server.rb', line 20 def to_rack_app me = self Rack::Builder.new do use ::Tres::RackLogger use Rack::Lint run me end end |