Skip to content

Instantly share code, notes, and snippets.

@shunwen
Created February 17, 2014 05:16
Show Gist options
  • Save shunwen/9045123 to your computer and use it in GitHub Desktop.
Save shunwen/9045123 to your computer and use it in GitHub Desktop.
class Foo
def self.do_something *args
new(args).do_something
end
def initialize *args
# set instance variables
@var1 = args[0]
# and so on
end
def do_something
# do something...
return self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment