Sha256: 8bae1c99630551cb1e1b6ab208887a2323be2f38beab46de684e5c66a0bcc4c9

Contents?: true

Size: 247 Bytes

Versions: 1

Compression:

Stored size: 247 Bytes

Contents

module Prorate
  module BlockFor
    def self.block!(redis:, id:, duration:)
      k = "bl:%s" % id
      redis.setex(k, duration.to_i, 1)
    end
  
    def self.blocked?(redis:, id:)
      k = "bl:%s" % id
      !!redis.get(k)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prorate-0.1.0 lib/prorate/block_for.rb