Class: PhantomProxy::TemplateRenderer
- Inherits:
-
Object
- Object
- PhantomProxy::TemplateRenderer
- Defined in:
- lib/phantom_proxy/helper/template_renderer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(controller_binding_) ⇒ TemplateRenderer
constructor
A new instance of TemplateRenderer.
- #render(template_name, bind = nil) ⇒ Object
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 |