Sha256: 8c2f459d33e66e2dde98f720df34db633449690013cd37ecd080ec5e47a36fac

Contents?: true

Size: 567 Bytes

Versions: 6

Compression:

Stored size: 567 Bytes

Contents

module Troo
  class Esc
    extend Term::ANSIColor
  end

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

    include DecoratorHelpers

    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

6 entries across 6 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo/presentation/template.rb
troo-0.0.6 lib/troo/presentation/template.rb
troo-0.0.5 lib/troo/presentation/template.rb
troo-0.0.4 lib/troo/presentation/template.rb
troo-0.0.3 lib/troo/presentation/template.rb
troo-0.0.2 lib/troo/presentation/template.rb