Module: Surveyor::MustacheContext

Included in:
Surveyor::Models::QuestionGroupMethods
Defined in:
lib/surveyor/mustache_context.rb

Instance Method Summary collapse

Instance Method Details

#in_context(text, context = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/surveyor/mustache_context.rb', line 3

def in_context(text, context=nil)
  case context
  when NilClass then text
  when Hash     then Mustache.render(text, context)
  else               context.render(text)
  end
end