Hello, first time posting on forums!
I've gotten myself stuck on my final project. I am trying to make it create a new task.
the result reads when I run it in terminal.
test.rb:9:in 'add': undefined local variable or methad 'all_tasks' for #<List:0x29fa798 @all_tasks=
This is the code I'm currently using.
class List attr_writer :all_tasks def initialize @all_tasks =  end def add(task) all_tasks << task end def show all_tasks end #Things left to do #Insert list #Add task to list #Show all tasks #Read a task from a file #Write a list to a file #Delete a task #Update a task end class Task attr_reader :description def initialize (description) end end #Runs the program if __FILE__ == $PROGRAM_NAME my_list=List.new puts 'you have created a new list' my_list.add(Task.new('THIS is a DESCRIPTION')) puts 'you have made a new task' end
My objective is to make the error go away so I can continue coding. As it stands, it's somehow broken because I probably messed up the format somehow. Could someone give me a hint to where it is?
Command says line 9... I've been staring at it for a couple hours looking through web pages to find hints