Created
June 3, 2010 16:43
-
-
Save mendicantx/424124 to your computer and use it in GitHub Desktop.
This file contains 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
#uses transient baz | |
class Foo | |
def new(baz = Baz.new) | |
@baz = baz | |
end | |
# do stuff with baz here | |
end | |
#uses singleton baz | |
class Bar | |
def new(baz = Baz.singleton) | |
@baz = baz | |
end | |
# do stuff with baz here | |
end | |
class Baz | |
extend CanBeSingleton | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment