Sha256: 8d9dbd847647f5e8060cde0cc8dcbaddfc0480e80b452d6c05f9810e7c063ff0

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

module Polygon
  module Helpers

    def static;    settings.static;    end
    def dynamic;   settings.dynamic;   end
    def templates; settings.templates; end

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

    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

  end # module Helpers
end # module Polygon

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polygon-0.0.3 lib/polygon/helpers.rb
polygon-0.0.2 lib/polygon/helpers.rb
polygon-0.0.1 lib/polygon/helpers.rb