Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Book
- attr_accessor :author
- attr_reader :title
- attr_writer :comments
- def initialize(author, title)
- @author = author
- @title = title
- @comments = []
- end
- end
- book = Book.new("Chuck Palahniuk", "Fight Club")
- book.comments << "#{book.title} was a good book"
Add Comment
Please, Sign In to add comment