Module: Ramaze::View::Ezamar

Defined in:
lib/ramaze/view/ezamar.rb

Overview

View adapter for the Ezamar template engine. More information about this engine can be found here: https://github.com/manveru/ezamar

Constant Summary

TRANSFORM_PIPELINE =
[ ::Ezamar::Element ]

Class Method Summary (collapse)

Class Method Details

+ (Object) call(action, string)



12
13
14
15
16
# File 'lib/ramaze/view/ezamar.rb', line 12

def self.call(action, string)
  ezamar = View.compile(string){|s| compile(action, s) }
  html = ezamar.result(action.binding)
  return html, 'text/html'
end

+ (Object) compile(action, template)



18
19
20
21
22
23
24
# File 'lib/ramaze/view/ezamar.rb', line 18

def self.compile(action, template)
  file = action.view || __FILE__

  TRANSFORM_PIPELINE.each{|tp| template = tp.transform(template) }

  ::Ezamar::Template.new(template, :file => file)
end