Module: Tap::Support::Gems::Rack::Render
- Defined in:
- lib/tap/support/gems/rack.rb
Instance Method Summary collapse
Instance Method Details
#render(path, attrs = {}) ⇒ Object
212 213 214 |
# File 'lib/tap/support/gems/rack.rb', line 212 def render(path, attrs={}) renderer(path).build(attrs) end |
#renderer(path) ⇒ Object
206 207 208 209 210 |
# File 'lib/tap/support/gems/rack.rb', line 206 def renderer(path) template = env.search_path(:template, path) {|file| File.file?(file) } raise("no such template: #{path}") if template == nil Tap::Support::Templater.new(File.read(template), marshal_dump).extend(Render) end |