Class: Renshi::Frameworks::Rails::Plugin

Inherits:
ActionView::TemplateHandler
  • Object
show all
Defined in:
lib/renshi/frameworks/rails.rb

Overview

this is an old, first try of integrating with Rails, without compilable templates use it for older Rails versions (pre 2.2.0, I think).

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view = nil) ⇒ Plugin

Returns a new instance of Plugin.



12
13
14
# File 'lib/renshi/frameworks/rails.rb', line 12

def initialize(view = nil)
  @view = view
end

Class Method Details

.call(template) ⇒ Object



8
9
10
# File 'lib/renshi/frameworks/rails.rb', line 8

def self.call(template)
  "#{name}.new(self).render(template, local_assigns)"
end

Instance Method Details

#render(template, local_assigns) ⇒ Object



16
17
18
19
# File 'lib/renshi/frameworks/rails.rb', line 16

def render(template, local_assigns)        
  out = Renshi::Parser.parse(template.source, @view.renshi_binding)
  return out
end