Class: Deas::SinatraRunner
Instance Attribute Summary
Attributes inherited from Runner
#handler, #handler_class, #logger, #params, #request, #response, #router, #session, #template_source
Instance Method Summary
collapse
Methods inherited from DeasRunner
#run
Methods inherited from Runner
#partial, #render, #source_partial
Constructor Details
#initialize(handler_class, args = nil) ⇒ SinatraRunner
Returns a new instance of SinatraRunner.
7
8
9
10
|
# File 'lib/deas/sinatra_runner.rb', line 7
def initialize(handler_class, args = nil)
@sinatra_call = (args || {})[:sinatra_call]
super(handler_class, args)
end
|
Instance Method Details
#content_type(*args) ⇒ Object
22
23
24
|
# File 'lib/deas/sinatra_runner.rb', line 22
def content_type(*args)
@sinatra_call.content_type(*args)
end
|
#halt(*args) ⇒ Object
14
15
16
|
# File 'lib/deas/sinatra_runner.rb', line 14
def halt(*args)
@sinatra_call.halt(*args)
end
|
30
31
32
|
# File 'lib/deas/sinatra_runner.rb', line 30
def (*args)
@sinatra_call.(*args)
end
|
#redirect(*args) ⇒ Object
18
19
20
|
# File 'lib/deas/sinatra_runner.rb', line 18
def redirect(*args)
@sinatra_call.redirect(*args)
end
|
#send_file(file_path, opts = nil, &block) ⇒ Object
41
42
43
44
45
46
|
# File 'lib/deas/sinatra_runner.rb', line 41
def send_file(file_path, opts = nil, &block)
if self.content_type.nil?
self.content_type(get_content_type_ext(file_path))
end
@sinatra_call.send_file(file_path, opts || {}, &block)
end
|
#source_render(source, template_name, locals = nil) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/deas/sinatra_runner.rb', line 34
def source_render(source, template_name, locals = nil)
if self.content_type.nil?
self.content_type(get_content_type_ext(template_name) || 'html')
end
super
end
|
#status(*args) ⇒ Object
26
27
28
|
# File 'lib/deas/sinatra_runner.rb', line 26
def status(*args)
@sinatra_call.status(*args)
end
|