Class: Usmu::Template::Helpers
- Inherits:
-
Object
- Object
- Usmu::Template::Helpers
- Defined in:
- lib/usmu/template/helpers.rb
Overview
Helper functions that get imported into the local scope of templates
Instance Method Summary collapse
-
#include(name, args = {}) ⇒ String
Finds and renders a named include.
-
#initialize(configuration) ⇒ Helpers
constructor
Create a new Helpers instance.
Constructor Details
#initialize(configuration) ⇒ Helpers
Create a new Helpers instance. These are created on demand as needed by templates, there is not a singleton instance.
10 11 12 |
# File 'lib/usmu/template/helpers.rb', line 10 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#include(name, args = {}) ⇒ String
Finds and renders a named include.
24 25 26 27 28 |
# File 'lib/usmu/template/helpers.rb', line 24 def include(name, args = {}) inc = Usmu::Template::Include.find_include(@configuration, name) inc.arguments = args inc.render end |