Sha256: 388a8ba16a86edf3bcd26637c9adc8734ff1076bdc26ae907eff23df7fa7ae16

Contents?: true

Size: 386 Bytes

Versions: 13

Compression:

Stored size: 386 Bytes

Contents

require "haml"

module Murdoc
  class Formatter
    attr_accessor :template

    def initialize(template_or_filename)
      if File.exists?(template_or_filename)
        @template = File.read(template_or_filename)
      else
        @template = template_or_filename
      end
    end

    def render(locals = {})
      ::Haml::Engine.new(template).render(self, locals)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
murdoc-0.1.13 lib/murdoc/formatter.rb
murdoc-0.1.12 lib/murdoc/formatter.rb
murdoc-0.1.11 lib/murdoc/formatter.rb
murdoc-0.1.10 lib/murdoc/formatter.rb
murdoc-0.1.9 lib/murdoc/formatter.rb
murdoc-0.1.8 lib/murdoc/formatter.rb
murdoc-0.1.7 lib/murdoc/formatter.rb
murdoc-0.1.6 lib/murdoc/formatter.rb
murdoc-0.1.5 lib/murdoc/formatter.rb
murdoc-0.1.3 lib/murdoc/formatter.rb
murdoc-0.1.2 lib/murdoc/formatter.rb
murdoc-0.1.1 lib/murdoc/formatter.rb
murdoc-0.1.0 lib/murdoc/formatter.rb