Class: Maildis::TemplateLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/maildis/template_loader.rb

Class Method Summary collapse

Class Method Details

.load(template_path) ⇒ Object



7
8
9
10
11
12
# File 'lib/maildis/template_loader.rb', line 7

def load(template_path)
  path = File.expand_path(template_path)
  type = File.extname(path) == Template::PLAIN_EXT ? Template::PLAIN : Template::HTML 
  content = File.read path
  Template.new type, content
end