Intro to Object Orientation - Ruby
Last updated
Last updated
Define a new class using the class
keyword.
Instantiate instances of the class with the class constructor new
.
Add instance methods to your class with def
in the body of the class.
Set instance variables through writer instance methods.
Identify the scope of an instance variable.
Read an instance variable through a reader instance method.
Use attr_accessor
to define reader and writer methods for attributes.
Hook into an object's instantiation with #initialize
.
<iframe width="100%" height="720" src="" frameborder="0" allowfullscreen></iframe>
This video is meant to be a review of the first few topics in Object Orientation in Ruby.
View on Learn.co and start learning to code for free.