Skip to content

Instantly share code, notes, and snippets.

@garethrees
Created January 12, 2014 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garethrees/8386142 to your computer and use it in GitHub Desktop.
Save garethrees/8386142 to your computer and use it in GitHub Desktop.
class WelcomeMessage < ERB
def self.template
"Welcome, <%= @name %>"
end
def initialize(name, options = {})
@name = name
@template = options.fetch(:template, self.class.template)
super(@template)
end
def result
super(binding)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment