Created
September 12, 2018 14:32
-
-
Save hackvan/0685f1e338c0d9f1f61458dde56bf3aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Esta definición: | |
class Example | |
attr_accessor :x | |
end | |
## Es equivalente a: | |
class Example | |
def x | |
@x | |
end | |
def x=(value) | |
@x = value | |
end | |
end | |
ex.x # => 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment