Created
September 15, 2017 10:39
-
-
Save kalorz/02de294b85f85f74125d94eee602652c to your computer and use it in GitHub Desktop.
Ruby Gotchas: accessor return value
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 | |
def self.bar=(value) | |
@foo = value | |
return 'OK' | |
end | |
end | |
Foo.bar = 3 # => 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment