Class: Nyara::View::Slim

Inherits:
Object show all
Defined in:
lib/nyara/view_handlers/slim.rb

Class Method Summary collapse

Class Method Details

.src(template) ⇒ Object


6
7
8
9
10
11
12
13
# File 'lib/nyara/view_handlers/slim.rb', line 6

def self.src template
  t = ::Slim::Template.new(nil, nil, pretty: false){ template }
  src = t.instance_variable_get :@src
  if src.start_with?('_buf = []')
    src.sub! '_buf = []', '_buf = @_nyara_view.out'
  end
  src
end