Skip to content

Instantly share code, notes, and snippets.

@Fokusnica
Created June 27, 2015 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fokusnica/c4cbef66bae8d399e297 to your computer and use it in GitHub Desktop.
Save Fokusnica/c4cbef66bae8d399e297 to your computer and use it in GitHub Desktop.
Additional practice Book
class Book
# attr_accessor :author_name, :book_title
attr_writer :author_name, :book_title
attr_reader :author_name, :book_title
def initialize (author_name = nil, book_title = nil)
@author_name = author_name.to_s
@book_title = book_title.to_s
end
def output
puts "#{author_name} '#{book_title}'"
end
end
#book1 = Book.new("Jane Austen", "Pride and Prejudice")
#book1.output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment