Created
March 16, 2016 21:36
-
-
Save mindplace/ee370d161d1cc016b224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Library | |
| attr_accessor :books | |
| def initialize | |
| @books = [] | |
| end | |
| def add_book(title, author) | |
| @books << Book.new(title, author) | |
| end | |
| def suggest_a_book | |
| p "Why not pick up #{books.sample.title}?" | |
| end | |
| def suggest_an_author | |
| p "How about reading something by #{books.sample.author}?" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment