Module: Polygon::Helpers
- Defined in:
- lib/polygon/helpers.rb
Instance Method Summary collapse
- #default_wlang_context ⇒ Object
- #dynamic ⇒ Object
- #static ⇒ Object
- #templates ⇒ Object
- #wlang(tpl, ctx = {}) ⇒ Object
Instance Method Details
#default_wlang_context ⇒ Object
8 9 10 |
# File 'lib/polygon/helpers.rb', line 8 def default_wlang_context { "environment" => settings.environment } end |
#dynamic ⇒ Object
5 |
# File 'lib/polygon/helpers.rb', line 5 def dynamic; settings.dynamic; end |
#static ⇒ Object
4 |
# File 'lib/polygon/helpers.rb', line 4 def static; settings.static; end |
#templates ⇒ Object
6 |
# File 'lib/polygon/helpers.rb', line 6 def templates; settings.templates; end |
#wlang(tpl, ctx = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/polygon/helpers.rb', line 12 def wlang(tpl, ctx = {}) tpl = templates/"#{tpl}.whtml" if tpl.is_a?(Symbol) ctx = (ctx && ctx.to_hash) || {} ctx = default_wlang_context.to_hash.merge(ctx) WLang::file_instantiate tpl, ctx end |