Skip to content

Instantly share code, notes, and snippets.

@ianterrell
Created July 24, 2011 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianterrell/1102108 to your computer and use it in GitHub Desktop.
Save ianterrell/1102108 to your computer and use it in GitHub Desktop.
module Foo
def self.included(base)
class << base
attr_accessor :bar
end
end
def set
self.class.bar = "hello there"
end
end
class X
include Foo
end
x = X.new
x.set
puts X.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment