class Rory::Renderer::Context
Attributes
base_path[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/rory/renderer/context.rb, line 9 def initialize(options = {}) (options[:locals] || {}).each do |key, value| singleton_class.send(:define_method, key) { value } end @app = options[:app] @base_path = options[:base_path] end
Public Instance Methods
get_binding()
click to toggle source
# File lib/rory/renderer/context.rb, line 17 def get_binding binding end
render(template_name, opts = {})
click to toggle source
# File lib/rory/renderer/context.rb, line 21 def render(template_name, opts = {}) opts = { :layout => false, :app => @app, :base_path => @base_path }.merge(opts) renderer = Rory::Renderer.new(template_name, opts) renderer.render end