class Erber::Templater

Public Class Methods

new(template_text, mash_type = Hashie::Mash) click to toggle source
# File lib/erber/templater.rb, line 12
def initialize(template_text, mash_type = Hashie::Mash)
  @template = ERB.new(template_text, 0, "% <> > -")
  @mash_type = mash_type
end

Public Instance Methods

render(properties_hash) click to toggle source
# File lib/erber/templater.rb, line 17
def render(properties_hash)
  mash = @mash_type.new(properties_hash)

  mash.extend BindingMixin

  @template.result(mash.get_binding)
end