Sha256: 81c01a036879313f4362e1d9165018ef346c92248cd2ac65f251ef04d1014eb3
Contents?: true
Size: 1005 Bytes
Versions: 2
Compression:
Stored size: 1005 Bytes
Contents
require 'malt/engines/abstract' module Malt::Engine # Erector # # http://erector.rubyforge.org/userguide.html # class Erector < Abstract default :erector # def intermediate(params) text = params[:text] Class.new(::Erector::Widget) do module_eval %{ def content; #{text}; end } end end # def render(params, &yld) into = params[:to] case into when :html, nil render_html(params, &yld) else super(params, &yld) end end # def render_html(params={}, &yld) #text = params[:text] file = params[:file] data = params[:data] data = make_hash(data, &yld) intermediate(params).new(data).to_html end private # Load Erector library if not already loaded. def initialize_engine return if defined? ::Erector require_library 'erector' end # def engine_options(params) opts = {} opts end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
malt-0.3.0 | lib/malt/engines/erector.rb |
malt-0.2.0 | lib/malt/engines/erector.rb |