Skip to content

Instantly share code, notes, and snippets.

@mindplace
Created March 16, 2016 21:36
Show Gist options
  • Select an option

  • Save mindplace/ee370d161d1cc016b224 to your computer and use it in GitHub Desktop.

Select an option

Save mindplace/ee370d161d1cc016b224 to your computer and use it in GitHub Desktop.
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