Created
December 5, 2017 00:26
-
-
Save krsnachandra/7139e0928a0d89f707ff4ef686d3ecd0 to your computer and use it in GitHub Desktop.
Instance variables exercise
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') | |
puts p.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment