Class: Sinatra::Controller
- Inherits:
-
Object
- Object
- Sinatra::Controller
- Includes:
- Templates
- Defined in:
- lib/sinatra-controllers.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#request ⇒ Object
Returns the value of attribute request.
-
#template_cache ⇒ Object
Returns the value of attribute template_cache.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params, request) ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
#initialize(params, request) ⇒ Controller
Returns a new instance of Controller.
5 6 7 8 9 10 |
# File 'lib/sinatra-controllers.rb', line 5 def initialize(params,request) @params = params @request = request @template_cache = Tilt::Cache.new rescue 'sinatra < 1.0' @templates = {} end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/sinatra-controllers.rb', line 3 def params @params end |
#request ⇒ Object
Returns the value of attribute request.
3 4 5 |
# File 'lib/sinatra-controllers.rb', line 3 def request @request end |
#template_cache ⇒ Object
Returns the value of attribute template_cache.
3 4 5 |
# File 'lib/sinatra-controllers.rb', line 3 def template_cache @template_cache end |
Class Method Details
.templates ⇒ Object
14 15 16 |
# File 'lib/sinatra-controllers.rb', line 14 def templates {} end |
.views ⇒ Object
12 13 |
# File 'lib/sinatra-controllers.rb', line 12 def views end |