VelocityCheck
Lets you know if something is happening too often.
Installation
Add this line to your application's Gemfile:
gem 'velocity_check'
And then execute:
$ bundle
Or install it yourself as:
$ gem install velocity_check
Usage
SNEEZE_CHECK = VelocityCheck.new(:name => "sneeze", :limit => 10, :time_period => 600, :client => DALLI_CLIENT)
class Person
def initialize(name)
@name = name
end
def sneeze!
if SNEEZE_CHECK.check(@name)
puts "#{@name} has sneezed too much recently"
end
end
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request