Class: Psychic::MustacheTokenHandler
- Inherits:
-
Object
- Object
- Psychic::MustacheTokenHandler
- Defined in:
- lib/psychic/tokens.rb
Instance Method Summary collapse
-
#initialize(template) ⇒ MustacheTokenHandler
constructor
A new instance of MustacheTokenHandler.
- #render(variables = {}) ⇒ Object
- #tokens ⇒ Object
Constructor Details
#initialize(template) ⇒ MustacheTokenHandler
Returns a new instance of MustacheTokenHandler.
27 28 29 |
# File 'lib/psychic/tokens.rb', line 27 def initialize(template) @template = Mustache::Template.new(template) end |
Instance Method Details
#render(variables = {}) ⇒ Object
35 36 37 |
# File 'lib/psychic/tokens.rb', line 35 def render(variables = {}) Mustache.render(@template, variables) end |
#tokens ⇒ Object
31 32 33 |
# File 'lib/psychic/tokens.rb', line 31 def tokens @template. end |