Having difficulty with step 5 of the Ruby Final Project. After getting repeated error messages with my own code, I gave in and copied out the solution code verbatim but still seem to be hitting a brick wall.
So code is entered as:
class List attr_reader :all_tasks if __FILE__ == $PROGRAM_NAME my_list = List.new puts "You have created a new list" my_list.add(Task.new("Learn Ruby")) puts "You have added a task to the ToDo List" end def initialize @all_tasks =  end def add(task) all_tasks << task end end class Task attr_reader :description def initialize(description) @description = description end end
and when running I receive the following error message:
➜my_final_Ruby_project** ruby todo.rb You have created a new list odo.rb:6:in `<class:List>': uninitialized constant List::Task (NameError) from todo.rb:1:in `<main>'
From research online I can see that Uninitialized Constant is a fairly common fault but I’m not sure what’s causing it.
Could some kind soul explain where I’m going wrong?