Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drbragg/party-module
Launch Homework
https://github.com/drbragg/party-module
Last synced: 10 days ago
JSON representation
Launch Homework
- Host: GitHub
- URL: https://github.com/drbragg/party-module
- Owner: DRBragg
- Created: 2017-07-26T20:45:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T13:59:43.000Z (over 7 years ago)
- Last Synced: 2024-11-09T01:45:48.242Z (2 months ago)
- Language: Ruby
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
Do you hear that noise? The rumbling of fun in the distance, the carefree destruction of our free time and supply of intoxicants...
## It's Party Time.
In the associated `code.rb` file, we've defined a `module`, `PartyGoer`, that we're going to use to define the behavior of the people invited to the party! When each guest comes in, we're going to include this module and pass its methods on! The only reason to touch the `launcher.rb` is for including or extending additional modules.
Our parties have simple rules:
- Party goers should be able to `#drink`, `#sing`, and `#cause_havoc`.
- `#drink` returns `true` until you try to have a fourth drink, after which it returns `false`.
- `#sing` should always return a string and should print out the chorus to your favorite [party anthem](https://www.google.com/search?q=party+rock+anthem+lyrics). Or, you could utilize the `say` command coupled with a [`system` call](https://ruby-doc.org/core/Kernel.html#method-i-system) to chant "Party party party!" (Mac OS, only).
- Calling `#cause_havoc` should raise a `PersonalizedHavocError` which inherits from `StandardError` and contains a custom error message.
- The `PartyGoer` module should have an `invited?` method. When the `Launcher` class includes the `PartyGoer` module, `invited?` should be a class method in the `Launcher` class that returns `true`.
- As a "stretch goal", write unit tests for your module.