Sha256: 07ced42345f1e678ec04363a05cdd8d35579a4f4f5173803d89ec51e2bd829d9

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

require_relative 'errors'

module Jackpot
  class Cron

    def initialize(customer_storage, logger)
      @customer_storage = customer_storage
      @logger           = logger
    end 

    def run
      overdue_customers = @customer_storage.overdue
      overdue_customers.each do |c|
        begin 
          c.pay_subscription
        rescue Jackpot::Error => e
          @logger.error "Something was wrong when trying to process #{c} payment. Exception was #{e}"
        end 
      end 
    end 
  end 
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackpot-0.0.3 lib/jackpot/cron.rb