Class: Objectify::Rails::Renderer
- Inherits:
-
Object
- Object
- Objectify::Rails::Renderer
- Defined in:
- lib/objectify/rails/renderer.rb
Instance Method Summary collapse
- #action(action, opts) ⇒ Object
- #data(data) ⇒ Object
- #file(file, opts) ⇒ Object
-
#initialize(controller) ⇒ Renderer
constructor
A new instance of Renderer.
- #nothing(opts) ⇒ Object
- #partial(partial, opts) ⇒ Object
- #redirect_to(*args) ⇒ Object
- #render(opts) ⇒ Object
- #respond_to ⇒ Object
- #template(template, opts) ⇒ Object
Constructor Details
#initialize(controller) ⇒ Renderer
Returns a new instance of Renderer.
4 5 6 |
# File 'lib/objectify/rails/renderer.rb', line 4 def initialize(controller) @controller = controller end |
Instance Method Details
#action(action, opts) ⇒ Object
12 13 14 |
# File 'lib/objectify/rails/renderer.rb', line 12 def action(action, opts) @controller.render opts.merge(:action => action) end |
#data(data) ⇒ Object
42 43 44 |
# File 'lib/objectify/rails/renderer.rb', line 42 def data(data) @controller.instance_variable_set(:@objectify_data, data) end |
#file(file, opts) ⇒ Object
20 21 22 |
# File 'lib/objectify/rails/renderer.rb', line 20 def file(file, opts) @controller.render opts.merge(:file => file) end |
#nothing(opts) ⇒ Object
24 25 26 |
# File 'lib/objectify/rails/renderer.rb', line 24 def nothing(opts) @controller.render opts.merge(:nothing => true) end |
#partial(partial, opts) ⇒ Object
16 17 18 |
# File 'lib/objectify/rails/renderer.rb', line 16 def partial(partial, opts) @controller.render opts.merge(:partial => partial) end |
#redirect_to(*args) ⇒ Object
38 39 40 |
# File 'lib/objectify/rails/renderer.rb', line 38 def redirect_to(*args) @controller.redirect_to(*args) end |
#render(opts) ⇒ Object
28 29 30 |
# File 'lib/objectify/rails/renderer.rb', line 28 def render(opts) @controller.render opts end |
#respond_to ⇒ Object
32 33 34 35 36 |
# File 'lib/objectify/rails/renderer.rb', line 32 def respond_to @controller.respond_to do |format| yield(format) end end |
#template(template, opts) ⇒ Object
8 9 10 |
# File 'lib/objectify/rails/renderer.rb', line 8 def template(template, opts) @controller.render opts.merge(:template => template) end |