Class: PhantomProxy::TemplateRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/phantom_proxy/helper/template_renderer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller_binding_) ⇒ TemplateRenderer

Returns a new instance of TemplateRenderer.



17
18
19
# File 'lib/phantom_proxy/helper/template_renderer.rb', line 17

def initialize(controller_binding_)
  @controller_binding=controller_binding_
end

Class Method Details

.create(binding_) ⇒ Object



13
14
15
# File 'lib/phantom_proxy/helper/template_renderer.rb', line 13

def self.create(binding_)
  (PhantomProxy.respond_to?(:env) && PhantomProxy.env == :production) ? TemplateRenderer.new(binding_) : ReloadTemplateRenderer.new(binding_)
end

Instance Method Details

#render(template_name, bind = nil) ⇒ Object



21
22
23
# File 'lib/phantom_proxy/helper/template_renderer.rb', line 21

def render(template_name, bind=nil)
  template(template_name).result(bind||controller_binding)
end