Sha256: bf25c659d20093b159c1a20a999d7308a09ee2e31935da3792742b66bfc42167

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

module Troo
  class Template
    include DecoratorHelpers

    class << self
      # @param  []
      # @param  []
      # @return []
      def parse(object, path)
        new(object, path).parse
      end
    end

    # @param  []
    # @param  []
    # @return []
    def initialize(object, path)
      @object, @path = object, path
    end

    # @return []
    def parse
      ERB.new(load, nil, '-').result(binding)
    end

    private

    attr_reader :object, :path

    def load
      File.read(File.dirname(__FILE__) + path)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
troo-0.0.15 lib/troo/presentation/template.rb
troo-0.0.14 lib/troo/presentation/template.rb
troo-0.0.13 lib/troo/presentation/template.rb
troo-0.0.12 lib/troo/presentation/template.rb
troo-0.0.11 lib/troo/presentation/template.rb