Method: Rabl::Engine#render

Defined in:
lib/rabl/engine.rb

#render(context_scope = nil, locals = nil, &block) ⇒ Object

Renders the representation based on a previous apply Rabl::Engine.new(“…source…”, { :format => “xml” }).apply(context_scope, { :foo => “bar”, :object => @user }).render



47
48
49
50
51
52
53
# File 'lib/rabl/engine.rb', line 47

def render(context_scope = nil, locals = nil, &block)
  apply(context_scope, locals, &block) if context_scope || locals || block

  cache_results do
    send("to_#{@_options[:format]}")
  end
end