Module: Sablon::Context

Defined in:
lib/sablon/context.rb

Overview

A context represents the user supplied arguments to render a template.

This module contains transformation functions to turn a user supplied hash into a data structure suitable for rendering the docx template.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.content_regexObject

Returns the value of attribute content_regex.



9
10
11
# File 'lib/sablon/context.rb', line 9

def content_regex
  @content_regex
end

Class Method Details

.transform_hash(hash) ⇒ Object



13
14
15
# File 'lib/sablon/context.rb', line 13

def transform_hash(hash)
  Hash[hash.map { |k, v| transform_pair(k.to_s, v) }]
end