Skip to content

Instantly share code, notes, and snippets.

@maedhr
Created November 30, 2011 19:10
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 maedhr/1410352 to your computer and use it in GitHub Desktop.
Save maedhr/1410352 to your computer and use it in GitHub Desktop.
Class instance variables
class A
@foo = 'foo'
class << self
attr_accessor :foo
end
attr_accessor :foo
def initialize
@foo = 'bar'
end
end
A.foo != A.new.foo != A.new.class.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment