class Murdoc::Renderer

Attributes

template[RW]

Public Class Methods

new(template_or_filename) click to toggle source
# File lib/murdoc/renderer.rb, line 7
def initialize(template_or_filename)
  if File.exists?(template_or_filename)
    @template = File.read(template_or_filename)
  else
    @template = template_or_filename
  end
end

Public Instance Methods

render(locals = {}) click to toggle source
# File lib/murdoc/renderer.rb, line 15
def render(locals = {})
  ::Haml::Engine.new(template).render(self, locals)
end