OO Ruby Video: Object Orientation Overview
Last updated
Last updated
Explain how objects are metaphors for real life concepts
Define a new class with the class
keyword
Instantiate 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="" frameborder="0" allowfullscreen></iframe>
View on Learn.co and start learning to code for free.