#Ruby Classes
Fork and clone this repo to get started.
In each of the ruby files provided, create a class that meets the following requirements. Once the classes have been created, test them by creating an instance and calling the appropriate methods.
###Robot
- Create a
Robotclass - Initialize each
Robotwith anameandpurpose Robotshould have agreetmethod that returns"beep boop"
#####Robot Test
- Create one
Robotinstance with a name and purpose - Have the robot greet you
###Dice
- Create a
Diceclass - Initialize each
Dicewith anumber_of_sides(greater than 0). Diceshould have arollmethod that randomly returns a number from1up to thenumber_of_sides.- You'll need to call some type of random function
Diceshould have aget_rollsmethod that returns an array containing previous rolls.Diceshould have a class variable calledtotal_dicethat keeps track of how manyDiceinstances have been created.
#####Dice Test
- Create two new
Diceinstances with different numbers of sides - Roll each
Dicethree times - Print the rolls that each
Dicemade - Print the number of dice
###Agent
- Create a
Agentclass - Initialize each
Agentinstance with asecretandname Agentshould have a private method calledprint_secretthat will print Agent's secret.- Note that the
secretshould not be accessible by a getter/setter or by calling theprint_secretmethod.
- Note that the
Agentshould have ago_roguemethod that takes a boolean- If the boolean is
true, theAgentshould tell his secret by calling theprint_secretmethod - If the boolean is
false, nothing should happen
- If the boolean is
#####Agent Test
- Create two new
Agentinstances with different names and secrets - Tell the first agent to "go rogue"
- Tell the other agent to "not go rogue"