Sha256: ab8d5d9ba79b34dc8233180db855e834686dea37c14e4b0fd44c2ff01785cf23

Contents?: true

Size: 568 Bytes

Versions: 1

Compression:

Stored size: 568 Bytes

Contents

module Troo
  class Esc
    extend Term::ANSIColor
  end

  class Template
    include DecoratorHelpers

    class << self
      def parse(object, template_path)
        new(object, template_path).parse
      end
    end

    def initialize(object, template_path)
      @object        = object
      @template_path = template_path
    end

    def parse
      ERB.new(load_template, nil, '-').result(binding)
    end

    private

    attr_reader :object, :template_path

    def load_template
      File.read(File.dirname(__FILE__) + template_path)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 lib/troo/presentation/template.rb