lib/psychic/tokens.rb in psychic-runner-0.0.3 vs lib/psychic/tokens.rb in psychic-runner-0.0.4
- old
+ new
@@ -10,11 +10,11 @@
def tokens
@template.scan(@token_pattern).flatten.uniq
end
- def replace(variables = {})
+ def render(variables = {})
@template.gsub(@token_pattern) do
full_match = Regexp.last_match[0]
key = Regexp.last_match[1]
value = variables[key]
value = @token_replacement.gsub('\\1', value.to_s) unless @token_replacement.nil?
@@ -30,10 +30,10 @@
def tokens
@template.tags
end
- def replace(variables = {})
+ def render(variables = {})
Mustache.render(@template, variables)
end
end
end