class Tiltd::Content
Public Class Methods
find(relative)
click to toggle source
# File lib/tiltd/content.rb, line 3 def self.find(relative) relative = relative.gsub(%r{^/}, '') path = Dir.glob(relative + '.*').first path if path && File.file?(path) end
locate(path)
click to toggle source
# File lib/tiltd/content.rb, line 9 def self.locate(path) actual = find(path) actual = find(File.join(path, "index")) unless actual new(actual) if actual end
new(path)
click to toggle source
# File lib/tiltd/content.rb, line 16 def initialize(path) @template_class = Tilt[path] @template = @template_class.new(path) end
Public Instance Methods
body()
click to toggle source
# File lib/tiltd/content.rb, line 25 def body @template.render end
mime_type()
click to toggle source
# File lib/tiltd/content.rb, line 21 def mime_type @template_class.default_mime_type end