Sha256: f887058dd48970a1cea1b2c85ff27214a723ef8b7f733292441051b21c6a0ff2

Contents?: true

Size: 362 Bytes

Versions: 1

Compression:

Stored size: 362 Bytes

Contents

require 'erb'
require 'ostruct'

module Quicken
  module Helpers
    module Template
      def parse template
        @erb = ERB.new template, 0, '%<>'
      end

      def compile context
        @erb.result Context.new(context).bindings
      end

      class Context < OpenStruct
        def bindings
          binding
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quicken-ruby-0.1.1 lib/quicken/helpers/template.rb