Sha256: 4f842070bf10619ef481471925cadbadea217c2cf5bb8b5df593d2d2ea24c799

Contents?: true

Size: 430 Bytes

Versions: 6

Compression:

Stored size: 430 Bytes

Contents

module ErbAsterisk
  module Render
    # Render template
    def render(template, vars = {})
      log_debug("render: #{template}", 2)

      old_erb_output = @erb_output
      @erb_output = ''

      erb = new_erb(read_template(template))

      b = binding
      vars.each do |name, value|
        b.local_variable_set(name, value)
      end

      r = erb.result(b)
      @erb_output = old_erb_output
      r
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
erb_asterisk-0.0.19 lib/erb_asterisk/render.rb
erb_asterisk-0.0.18 lib/erb_asterisk/render.rb
erb_asterisk-0.0.17 lib/erb_asterisk/render.rb
erb_asterisk-0.0.16 lib/erb_asterisk/render.rb
erb_asterisk-0.0.15 lib/erb_asterisk/render.rb
erb_asterisk-0.0.14 lib/erb_asterisk/render.rb