Created
May 9, 2017 02:09
-
-
Save kevmor11/d90fbb316fb0c492186c3de3e746b417 to your computer and use it in GitHub Desktop.
Accessor practise
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 Person | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
end | |
p = Person.new('L. Ron') | |
p.name = 'Kevin' | |
p p.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment