Method: RateLimit::MySQL#set

Defined in:
lib/ratelimit/bucketbased.rb

#set(bucket) ⇒ Object

saves a bucket into the storage

  • Args :

    • bucket -> the Bucket to set. The name field in the Bucket option will be used as a key.

  • Returns :

    • an empty result set

  • Raises :

    • Mysql::Error -> any issue with the connection to the database or the SQL statements



147
148
149
# File 'lib/ratelimit/bucketbased.rb', line 147

def set(bucket)
	@queries['set'].execute(bucket.name, bucket.current, bucket.max, bucket.min, bucket.cost, bucket.refill_amount, bucket.refill_epoch, bucket.last_refill, bucket.total_used)
end