Class: Crosstest::Psychic::Tokens::MustacheTokenHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/crosstest/psychic/tokens.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ MustacheTokenHandler

Returns a new instance of MustacheTokenHandler


29
30
31
# File 'lib/crosstest/psychic/tokens.rb', line 29

def initialize(template)
  @template = Mustache::Template.new(template)
end

Instance Method Details

#render(variables = {}) ⇒ Object


37
38
39
# File 'lib/crosstest/psychic/tokens.rb', line 37

def render(variables = {})
  Mustache.render(@template, variables)
end

#tokensObject


33
34
35
# File 'lib/crosstest/psychic/tokens.rb', line 33

def tokens
  @template.tags
end