Module: Rcurse
- Defined in:
- lib/rcurse.rb,
lib/rcurse/engine.rb,
lib/rcurse/helper.rb,
lib/rcurse/context.rb
Overview
Rcurse - super simple template engine
Defined Under Namespace
Classes: Context, Engine, Helper
Class Method Summary (collapse)
-
+ (Object) add_helper(helper)
Add a helper to Rcurse, called automatically when creating a helper.
-
+ (Hash<Rcurse::Helper>) helpers
Available helpers.
-
+ (String) render(content, context = Context.new)
Render a template.
-
+ (String) render_file(filename, out_filename, context = Context.new)
Render a template file, optionally writing output to another file.
Class Method Details
+ (Object) add_helper(helper)
Add a helper to Rcurse, called automatically when creating a helper
5 6 7 |
# File 'lib/rcurse/helper.rb', line 5 def self.add_helper helper @helpers[helper.name] = helper end |
+ (Hash<Rcurse::Helper>) helpers
Available helpers
12 13 14 |
# File 'lib/rcurse/helper.rb', line 12 def self.helpers @helpers end |
+ (String) render(content, context = Context.new)
Render a template
73 74 75 76 |
# File 'lib/rcurse/engine.rb', line 73 def self.render content, context = Context.new # proxy Rcurse::Engine.render content, context end |
+ (String) render_file(filename, out_filename, context = Context.new)
Render a template file, optionally writing output to another file
79 80 81 82 |
# File 'lib/rcurse/engine.rb', line 79 def self.render_file filename, out_filename, context = Context.new # proxy Rcurse::Engine.render_file filename, out_filename, context end |