You defined an initialization method, but forgot to assign values to instance variables, and a typo in the code caused an error, fixed it as:
book.rb
class Book
def initialize(name,author)
@name = name
@author = author
end
end
test.rb
require './book'
class Test
harry_potter = Book.new("Harry Potter", "JK")
end
, ? , , Ruby - . "The Book of Ruby" .