OO Ruby Video: Object Orientation Overview
Objectives
Explain how objects are metaphors for real life concepts
Define a new class with the
class
keywordInstantiate instances of the class with the class constructor
new
.Add attributes to our instances with setter/getter methods and instance variables
Use the attr_accessor, attr_reader and attr_writer methods to dynamically create setter and getter methods
Keep track of all our class' instances with class variables and class methods
Hook into an object's instantiation with #initialize
Explain when to use implicit versus explicit receivers
Define a class find_by_name method to find specific instances
<iframe width="100%" height="720" src="https://www.youtube.com/embed/Z_IoQCVNWtM?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
View OO Ruby Video: Object Orientation Overview on Learn.co and start learning to code for free.
Last updated