diff --git a/lib/ratelimit.rb b/lib/ratelimit.rb index b5da6ec..270065b 100644 --- a/lib/ratelimit.rb +++ b/lib/ratelimit.rb @@ -97,6 +97,7 @@ def within_bounds?(subject, options = {}) # @example Send an email as long as we haven't send 5 in the last 10 minutes # ratelimit.exec_with_threshold(email, [:threshold => 5, :interval => 600]) do # send_another_email + # ratelimit.add(email) # end def exec_within_threshold(subject, options = {}, &block) options[:threshold] ||= 30