Created
February 29, 2012 18:46
-
-
Save bcardarella/1943454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render_subject(context) | |
render subject, context | |
end | |
def render_content(context) | |
render content, context | |
end | |
private | |
def render(receiver, context) | |
receiver.gsub(/\{\{(.+?)\}\}/) do |s| | |
context.instance_eval("@#{$1}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment