Skip to content

Instantly share code, notes, and snippets.

@snusnu
Created November 20, 2008 01:12
Show Gist options
  • Save snusnu/26872 to your computer and use it in GitHub Desktop.
Save snusnu/26872 to your computer and use it in GitHub Desktop.
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