Skip to content

Instantly share code, notes, and snippets.

@jarib
Created June 9, 2010 20:41
Show Gist options
  • Save jarib/432138 to your computer and use it in GitHub Desktop.
Save jarib/432138 to your computer and use it in GitHub Desktop.
class Command
def self.before_main(*syms)
return @before_main_methods if syms.empty?
@before_main_methods = syms
end
def before_main
meths = self.class.before_main
meths.each { |m| send(m) } if meths
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment