Object-Oriented Programming in Ruby Activity

In this activity, you will learn about and practice object-oriented programming (OOP) in Ruby.

First, watch this video introduction to OOP.

Next, open the TryRuby Playground in your web browser:

https://try.ruby-lang.org/playground/

Then, watch each video below, entering the code shown into TryRuby and running the code. You must take screenshots as specified below to record your completion of the activity.

Important! Don’t just imitate the steps without understanding them. Be sure to pay close attention to what’s being said in the video, so you gain a deep understanding of how OOP in Ruby is actually done. If you have questions, don’t hesitate to post them to the #help-help-help channel in Discord.

Important! All screenshots must include your computer’s desktop in the background so that it is recognizable as your desktop.

Create Very Basic Class with Default Constructor

Add a Getter Method to the Class

Add Parameters to the Constructor

Define Default Parameter Values for the Constructor

Add a Setter Method to the Class

Generate an Attribute with Getter and Setter Methods

Make Two Collaborating Objects

Add a Method That Is More than a Mere Getter/Setter

Test Yourself!

Consider this object diagram similar to the one shown in the videos.

In the TryRuby Playground:

Andrews, Alice (alice.a@memphis.edu)

Submit to Canvas!

Insert your all your screenshots into a Word DOCX and submit the file in the appropriate Canvas Assignment.