Created
August 21, 2012 17:11
-
-
Save Mon-Ouie/3417427 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
class Foo | |
@ivar = "class ivar" | |
def initialize | |
@ivar = "instance ivar" | |
end | |
end | |
puts Foo.instance_variable_get(:@ivar) # class ivar | |
puts Foo.new.instance_variable_get(:@ivar) # instance ivar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment