Class: Objectify::Rails::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/objectify/rails/renderer.rb

Instance Method Summary collapse

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_toObject



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