Module: Polygon::Helpers

Defined in:
lib/polygon/helpers.rb

Instance Method Summary collapse

Instance Method Details

#default_wlang_contextObject



8
9
10
# File 'lib/polygon/helpers.rb', line 8

def default_wlang_context
  { "environment" => settings.environment }
end

#dynamicObject



5
# File 'lib/polygon/helpers.rb', line 5

def dynamic;   settings.dynamic;   end

#staticObject



4
# File 'lib/polygon/helpers.rb', line 4

def static;    settings.static;    end

#templatesObject



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