Today didn’t see much coding. Mostly because the Intro to Object Oriented Ruby is a 1:10.00 video by of Avi teaching the basics of OO Ruby. Which was good. I found that him talking through concepts made them more clear as I worked on just a couple labs afterwards. It also meant that I took some notes on things that I thought were most important.
Notes which of course I’ll share:
selfis the implicit receiver of all non-explicit method calls.
local variable is variable
instance variable is @variable
class variable is @@variable
attr_reader macro creates getter method
attr_writer macro creates setter method
attr_accessor macro creats both setter and getter method
Avi also talked about how he personally only used the
attr_accessor macro when he’s building stuff. Then after everything is working he takes away abilities depending on what the methods actually are doing. The
attr_accessor macro is the most flexible so it makes sense to use that by default.
Time spent today: 2:05
Time spent total: 47:20
Lessons completed today: 4
Lessons completed total: 234