You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: weekly_recurrence_pattern.rb
    path of file: ./repos/tracks/app/models/recurring_todos
    
    the code of the file until where you have to start completion: module RecurringTodos
  class We
    
    def get_next_date(previous)
      start = determine_start_date(previous)

      day = find_first_day_in_this_week(start)
      return day unless day == -1

      # we did not find anything this week, so check the nth next, starting from
      # sunday
      start = start + every_x_week.week - (start.wday).days

      start = find_first_day_in_this_week(start)
      return start unless start == -1

      raise Exception.new, "unable to find next weekly date (#{every_day})"
    end