Default value fuer max=10 or range=10, if it will be nil.

This commit is contained in:
Denis Knauf 2010-03-03 17:04:19 +01:00
parent 8877341fde
commit c20b420d4a

View file

@ -33,8 +33,8 @@ class Retries
attr_accessor :max, :range
attr_reader :count, :last
def initialize max = 10, range = 10
@max, @range, @count, @last = max, range, 0, Time.now
def initialize max = nil, range = nil
@max, @range, @count, @last = max || 10, range || 10, 0, Time.now
end
def retry?