Created
November 16, 2012 17:55
-
-
Save fabiokr/4089428 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 Example | |
attr_accessor :var_1, :var_2 | |
def with_self(var) | |
self.var_1 = var | |
end | |
def without_self(var) | |
var_2 = var | |
end | |
end | |
e = Example.new | |
e.with_self(:hello) | |
e.without_self(:world) | |
# Will be :hello | |
e.var_1 | |
# Will be nil | |
e.var_2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment