Class: Amiba::Tilt
- Inherits:
-
Object
- Object
- Amiba::Tilt
- Defined in:
- lib/amiba/tilt.rb
Class Method Summary collapse
Class Method Details
.new(obj, options = {}, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/amiba/tilt.rb', line 6 def self.new(obj, ={}, &block) if obj.is_a?(String) && File.exist?(obj) ::Tilt.new(obj, ) else if template_class = ::Tilt[obj.filename] block ||= proc { obj.content } template_class.new(obj.filename, nil, , &block) else raise "Can't find a template loader!" end end end |