Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.