Skip to content

Instantly share code, notes, and snippets.

@mendicantx
Created June 3, 2010 16:43
Show Gist options
  • Save mendicantx/424124 to your computer and use it in GitHub Desktop.
Save mendicantx/424124 to your computer and use it in GitHub Desktop.
#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