Guest User

Untitled

a guest
Jan 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.35 KB | None | 0 0
  1.       class Book
  2.         attr_accessor :author
  3.         attr_reader :title
  4.         attr_writer :comments
  5.         def initialize(author, title)
  6.           @author = author
  7.           @title = title
  8.           @comments = []
  9.         end
  10.       end
  11.  
  12.       book = Book.new("Chuck Palahniuk", "Fight Club")
  13. book.comments << "#{book.title} was a good book"
Add Comment
Please, Sign In to add comment