Created
November 20, 2008 01:12
-
-
Save snusnu/26872 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
module Foo | |
def foo | |
:foo | |
end | |
end | |
class Session | |
def user | |
@user ||= real_user_object | |
class << @user | |
include Foo | |
end | |
@user | |
end | |
def real_user_object | |
"user" | |
end | |
end | |
s = Session.new | |
u = s.user | |
u.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment