Class: ObjectsFramework::Object

Inherits:
Object
  • Object
show all
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



9
10
11
# File 'lib/objectsframework/templates.rb', line 9

def self.set_template_directory(dir)
  @@directory = dir
end

.set_template_layout(layout) ⇒ Object



5
6
7
# File 'lib/objectsframework/templates.rb', line 5

def self.set_template_layout(layout)
  @@layout = layout
end

Instance Method Details

#render(templatename) ⇒ Object



13
14
15
# File 'lib/objectsframework/templates.rb', line 13

def render(templatename)
  Tilt::ERBTemplate.new(@@directory+"/"+@@layout).render(self) {Tilt::ERBTemplate.new(@@directory+"/"+templatename).render(self)}
end