Class: Sinatra::Controller

Inherits:
Object
  • Object
show all
Includes:
Templates
Defined in:
lib/sinatra-controllers.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/sinatra-controllers.rb', line 3

def params
  @params
end

#requestObject

Returns the value of attribute request.



3
4
5
# File 'lib/sinatra-controllers.rb', line 3

def request
  @request
end

#template_cacheObject

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

.templatesObject



14
15
16
# File 'lib/sinatra-controllers.rb', line 14

def templates
  {}
end

.viewsObject



12
13
# File 'lib/sinatra-controllers.rb', line 12

def views
end