1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 05:28:37 +01:00

An an example of an instance variable assignment

This commit is contained in:
Alexander Zhuravlev 2013-07-17 05:22:32 +04:00
parent 9e44649842
commit 5267bff2cf

View File

@ -305,6 +305,8 @@ dwight = Human.new("Dwight K. Schrute")
# Let's call a couple of methods
jim.species #=> "H. sapiens"
jim.name #=> "Jim Halpert"
jim.name = "Jim Halpert II" #=> "Jim Halpert II"
jim.name #=> "Jim Halpert II"
dwight.species #=> "H. sapiens"
dwight.name #=> "Dwight K. Schrute"