Skip to content

Commit

Permalink
rewrite spec to make instructions/steps clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
msuzoagu committed Jun 12, 2015
1 parent 2db37ca commit 7752a28
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 129 deletions.
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,40 @@ resources: 1

## Introduction

To practice object oriented programming (OOP), you're going to create a Person class. Instances of your person class should be able to get paid, take a bath, call a friend, and start a conversation. They should also be able to tell you if they are happy and/or clean.
To practice object oriented programming (OOP), you're going to create a Person class. Each instance of the `Person` class will have the ablity to:
- get paid/receive payments
- take a bath
- call a friend
- start a conversation
- state if they are happy and/or clean

## Objectives
1. Gain proficiency instantiating a class
2. Gain ability to discern when to implement `attr_accessor`, `attr_reader`, and `attr_writer`
3. Gain abiity to discern when to define your own `attr_reader`(getter) and `attr_writer`(setter) methods

## Instructions
- First you need to create a person class that is initizlized with a name that cannot be changed.
- Each instance of class `Person`should be able to remember their name
- Each instance of class `Person` should start with $25 in their bank accounts
- Each instance of class `Person` should start with eight happiness points
- Each instance of class `Person` should start with eight hygiene points
- The happiness and hygiene points should be able to change, however the maximum and minimum points for both happiness and hygiene should be 10 and 0 respectively
- The amount in the bank account should also be able to change, though it has no max or min.

##### Basics
##### Non-attribute defining instance methods

Create a person class. This person should be initialized with a name that can't change. The person should be able to remember their name. Each instance of the person class should start with $25 in their bank accounts. They also should start with eight happiness points and eight hygiene points.
1. The `clean?` and `happy?` methods are pretty similiar: they should return `true` if the happiness or hygiene points exceed seven. Otherwise they should return false.

The happiness and hygiene points should be able to change, however they should max out at 10 and min out (pretend that's a thing) at 0. The amount in the bank account should also be able to change, though it has no max or min.
2. The `get_paid` method should accept a salary amount and add this to the person's bank account. Then the method should return the string "all about the benjamins".

##### More Methods
3. The `take_bath` method should increment the person's hygiene points by four and return the string "♪ Rub-a-dub just relaxing in the tub ♫".

The `clean?` and `happy?` methods are pretty similiar: they should return `true` if the happiness or hygiene points exceed seven. Otherwise they should return false.
4. The `work_out` method should increment the person's happiness by two points, decrease their hygiene by three points, and return the Queen lyrics, "♪ another one bites the dust ♫".

The `get_paid` method should accept a salary amount and add this to the person's bank account. Then the method should return the string "all about the benjamins".

The `take_bath` method should increment the person's hygiene points by four and return the string "♪ Rub-a-dub just relaxing in the tub ♫".

The `work_out` method should increment the person's happiness by two points, decrease their hygiene by three points, and return the Queen lyrics, "♪ another one bites the dust ♫".

The `call_friend` method should accept another instance of the Person class, or "friend". The method should increment the caller and the callee's happiness points by three. If Stella calls her friend Felix, the method should return "Hi Felix. It's Stella. How are you?"

Finally, the `start_conversation` method should accept two arguments, the person to start a conversation with and the topic of conversation.
* If the topic is politics, both people get sadder and the method returns "blah blah partisan blah lobbyist".
* If the topic is weather, both people get a little happier and the method returns "blah blah sun blah rain".
* If the topic is not politics or weather, their happiness points don't change and the method returns "blah blah blah blah blah".
5. The `call_friend` method should accept another instance of the Person class, or "friend". The method should increment the caller and the callee's happiness points by three. If Stella calls her friend Felix, the method should return "Hi Felix. It's Stella. How are you?"

6. Finally, the `start_conversation` method should accept two arguments, the person to start a conversation with and the topic of conversation.
* If the topic is politics, both people get sadder and the method returns "blah blah partisan blah lobbyist".
* If the topic is weather, both people get a little happier and the method returns "blah blah sun blah rain".
* If the topic is not politics or weather, their happiness points don't change and the method returns "blah blah blah blah blah".
Loading

0 comments on commit 7752a28

Please sign in to comment.