CSE190M [Ruby Section] Assignment #4

Object Oriented Programming in Ruby: Battwitter

Assignment Clarification

Twitter is one of the sites we introduced as using Ruby on Rails. The site works by prompting users for status updates that are 140 characters or less, fondly referred to as "tweets". It then posts these "tweets" to user pages, in which other users may read, reply, etc. It might help to think of each "tweet" as an Object for the purposes of this assignment.

Your mission is to make the "tweet" Object that effectively drives Batman's personal twitter page. The Dark Knight has customized his Twitter account to be a little more sophisticated than a normal one. Each time he updates, he submits a criminal name, the crime committed, and a rank of priority [how urgent / important this update is]. The object is described in detail below. We will provide you with a skeleton .erb document that will include most of the file processing and Object manipulation code. You only need to write the Object itself.

Data Management

baddies.txt - The .txt file in which all "tweets" should be stored. Each individual criminal update is stored on a single line of text as "<name>,<crime>,<rank>"

For example, when Batman is chasing Catwoman and The Joker, baddies.txt will look like this:

Catwoman,meowing too much,1
Joker,wearing too much make up,5

Object Implementation

Your implementation of the object should include all of the following methods:

Expected Behavior

To see a working example, check out Kelly's Battwitter


Skeleton Code

The skeleton code is available here. You should not need to modify the skeleton erb file.


A rediculously nerdy CSE190M assignment by TA Kelly.