Challenge 1: A Book Class — Solution class Book attr_accessor :title, :author, :pages def initialize(title, author, pages) @title = title @author = author @pages = pages end end book1 = Book.new("The Hobbit", "J.R.R. Tolkien", 310) book2 = Book.new("Dune", "Frank Herbert", 412) puts book1.title puts book2.title =begin Output: The Hobbit Dune Notes: - attr_accessor :title, :author, :pages generates a getter and setter for all three in one line, rather than writing six methods by hand. - initialize runs automatically when Book.new(...) is called, assigning each constructor argument to its matching @instance_variable. - book1.title and book2.title call the generated getter methods — no direct access to @title from outside the class is needed or possible. =end