Building a Message Tracker in Ruby
This guide walks through the steps to effectively build a method that can track text messages sent between users and keep a log of when the messages were sent.
Guide Tasks
- Read Tutorial
- Complete the Exercise
Summary
Build a method that keeps track of text messages sent between users.
Exercise Description
Define a class that can first, create a new text message. Second, determine the correct time and date of the text. Third, identify which user is sending the message and to whom they are sending it to. Lastly, be able to have a history of previous messages sent and received between the two users.
Example Data
{ :sender=>"Jordan", :message=>"Hi there", :timestamp=>Date.today }, { :sender=>"Tiffany", :message=>"Hi back", :timestamp=>Date.today }
Real World Usage
This exercise will teach you how to build a method that tracks text messages. Since everyone sends multiple texts a day, it makes sense to understand how it works. Although fairly simple to build, it is an important skill to know the steps to make it run properly.