Sha256: fbfc425f025277e11eb178b0c8c0d72fa230d7288b7bfbff5486a46c16a992dd

Contents?: true

Size: 402 Bytes

Versions: 7

Compression:

Stored size: 402 Bytes

Contents

module Economy
  module Rates
    class Base

      attr_reader :retries

      def initialize
        @retries = 0
      end

      def fetch
        begin
          call
        rescue
          if retries < 30
            sleep 60
            @retries += 1
            fetch
          else
            puts "Giving up after #{retries} retries"
          end
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
economy-5.1.0 lib/economy/rates/base.rb
economy-4.0.2.2 lib/economy/rates/base.rb
economy-4.0.2.1 lib/economy/rates/base.rb
economy-4.0.2.0 lib/economy/rates/base.rb
economy-4.0.1.0 lib/economy/rates/base.rb
economy-4.0.0.0 lib/economy/rates/base.rb
economy-0.0.1 lib/economy/rates/base.rb