Class: ObjectsFramework::Object
- Inherits:
-
Object
- Object
- ObjectsFramework::Object
- Defined in:
- lib/objectsframework/templates.rb
Overview
Add some methods to the ObjectsFramework Object class to enable easy rendering inside an object
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.set_template_directory(dir) ⇒ Object
8 9 10 |
# File 'lib/objectsframework/templates.rb', line 8 def self.set_template_directory(dir) @@directory = dir end |
.set_template_layout(layout) ⇒ Object
4 5 6 |
# File 'lib/objectsframework/templates.rb', line 4 def self.set_template_layout(layout) @@layout = layout end |
Instance Method Details
#render(templatename) ⇒ Object
12 13 14 |
# File 'lib/objectsframework/templates.rb', line 12 def render(templatename) Tilt::ERBTemplate.new(@@directory+"/"+@@layout).render(self) {Tilt::ERBTemplate.new(@@directory+"/"+templatename).render(self)} end |