Skip to content

Instantly share code, notes, and snippets.

@JSRossiter
Created May 8, 2017 20:43
Show Gist options
  • Save JSRossiter/ac8907bac4d74e0ff18c42a3b6f458cb to your computer and use it in GitHub Desktop.
Save JSRossiter/ac8907bac4d74e0ff18c42a3b6f458cb to your computer and use it in GitHub Desktop.
Instance variables exercise
class Person
attr_accessor(:name)
def initialize(name)
@name = name
end
# def name= name
# @name = name
# end
end
p = Person.new('L. Ron')
p.name = 'Jeff'
puts p.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment