title: how do I enable recurring reminders for different users in ruby?
body: <p>Currently, the users for my app set a specific date and time for a single reminder (using the Chronic gem).</p>
  
  <p>I have a cron job which runs every 10 minutes and checks if the time in the reminder is &lt; <code>Time.now</code> at which point, it sends the reminder and marks that reminder as sent.</p>
  
  <p>However, I want them to be able to specify recurring reminders.  The customer should be able to say, "Every other day at 10am".</p>
  
  <p>I can use <code>ice_cube</code> for the recurring part it seems.  Then I use Chronic to come up with the start time which will have the day and recurring time.</p>
  
  <p>But I don't have a good way to make it recurring since these are not separate events in the data base.</p>
  
  <p>Here is what I have tried:</p>
  
  <p>```
        reminder = response.body['results'] #array of recurring reminders with start_epoch and 'via'
        d {reminder}</p>
  
  <pre><code>  reminder.count.times do |i|
  
      schedule = IceCube::Schedule.new(now = Time.at(reminder[i]['value']['start_epoch'])) # get the initial start day and time
      schedule.add_recurrence_rule(IceCube::Rule.daily) #makes this a daily recurring, but how can I allow this to be customizable?
  
      if schedule.next_occurrence(Chronic.parse('today at 12:01AM')) &lt; Time.now # Check if today's occurence has happened yet
        bot_response = BotResponse.get_bot_response(bot_client_id, reminder[i]['value']['bot_input_keyword'])
  
        if reminder[i]['value']['via'] == 'slack'
          slack_response = BotMessage.send_slack(reminder[i]['value']['slack_channel'], 
                                                 bot_response[:bot_response])
          d {slack_response} 
  
        end #if
      end #if
    end #do
  </code></pre>
  
  <p>```</p>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li>Is there a way to tell when a reminder has been sent without writing each specific daily reminder to a database?</li>
  <li>Is there a more elegant way for the user in a text string to define the recurrence?  </li>
  </ul>