Skip to content

Instantly share code, notes, and snippets.

@deathbob
Created July 24, 2011 02:21
Show Gist options
  • Select an option

  • Save deathbob/1102125 to your computer and use it in GitHub Desktop.

Select an option

Save deathbob/1102125 to your computer and use it in GitHub Desktop.
module Foo
def self.included(base)
class << base
attr_accessor :bar
end
base.instance_eval do
@bar = "pig"
end
end
end
class Baz
include Foo
end
Baz.bar
Baz.instance_eval do
@bar = "cow"
end
Baz.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment