Class: Wunderbar::Rails::HtmlHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/wunderbar/rails.rb

Class Method Summary collapse

Class Method Details

.call(template) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/wunderbar/rails.rb', line 10

def self.call(template)
  %{
    compiled = Proc.new {#{template.source}}
    x = Wunderbar::HtmlMarkup.new(self);
    instance_variables.each do |var|
      x.instance_variable_set var, instance_variable_get(var)
    end
    x.instance_eval &compiled
    x._.target!
  }.strip # take care to preserve line numbers in original source
end