Ruby - Programming Language
This course covers the basics of programming in Ruby. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!

Initialize Method

Lesson 30
Author : GOUP
Last Updated : September, 2020


Code

Copyclass Book
     attr_accessor :title, :author
     def initialize(title, author)
          @title = title
          @author = author
     end
end

book1 = Book.new("Harry Potter", "JK Rowling")
# book1.title = "Half-Blood Prince"

puts book1.title