Created
August 22, 2009 23:02
-
-
Save joshbuddy/173030 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 OrOrEquals | |
def test | |
@test | |
end | |
def test=(test) | |
@test = test | |
'not test' | |
end | |
end | |
p (OrOrEquals.new.test = 'test') | |
# ruby 1.8 returns 'test' | |
# ruby 1.9 returns 'test' | |
p (OrOrEquals.new.test ||= 'test') | |
# ruby 1.8 returns 'test' | |
# ruby 1.9 returns 'not test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment