Ruby Ruby Objects and Classes Variables and Methods Attribute Readers

Anterrio Howard
Anterrio Howard
2,622 Points

In the Name class, create an attr_reader for the title instance variable

In the Name class, create an attr_reader for the title instance variable

name.rb
class Name
  def initialize(title, first_name, middle_name, last_name)
    @title = title
    @first_name = first_name
    @middle_name = middle_name
    @last_name = last_name
  end
end

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,735 Points

This is done in the previous video and shown in the teacher's notes for everything but title.