Class: Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Server
- Defined in:
- lib/server_skeleton/server.rb
Overview
Our server, a Sinatra app
Instance Method Summary collapse
-
#renderers ⇒ Object
For now, the only extra information being sent in ‘request’ is the method ‘slim’, which would otherwise be unavailable in the scope of a different class.
-
#request_obj ⇒ Object
The ‘request’ variable is passed along to route handlers Some extra information is attached to make for a simpler API.
Instance Method Details
#renderers ⇒ Object
For now, the only extra information being sent in ‘request’ is the method ‘slim’, which would otherwise be unavailable in the scope of a different class.
63 64 65 66 67 |
# File 'lib/server_skeleton/server.rb', line 63 def renderers OpenStruct.new( slim: method(:slim) ) end |
#request_obj ⇒ Object
The ‘request’ variable is passed along to route handlers Some extra information is attached to make for a simpler API
52 53 54 55 56 57 58 |
# File 'lib/server_skeleton/server.rb', line 52 def request_obj if !defined?(request.renderers) _renderers = method(:renderers) request.define_singleton_method(:renderers) { _renderers.call } end request end |