Class: AnyCache::Adapters::ActiveSupportNaiveStore::Decrement Private

Inherits:
Operation
  • Object
show all
Defined in:
lib/any_cache/adapters/active_support_naive_store/decrement.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

API:

  • private

Constant Summary collapse

DEFAULT_AMOUNT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Returns:

API:

  • private

1

Constants inherited from Operation

Operation::DEAD_TTL, Operation::NO_EXPIRATION_TTL, Operation::READ_MULTI_EMPTY_KEYS_SET

Instance Method Summary collapse

Methods inherited from Operation

#initialize

Constructor Details

This class inherits a constructor from AnyCache::Adapters::ActiveSupportNaiveStore::Operation

Instance Method Details

#call(key, amount = DEFAULT_AMOUNT, expires_in: NO_EXPIRATION_TTL) ⇒ Integer, Float

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Options Hash (expires_in:):

  • (NilClass, Integer)

Since:

  • 0.1.0

Parameters:

  • (defaults to: DEFAULT_AMOUNT)
  • (defaults to: NO_EXPIRATION_TTL)

    a customizable set of options

Returns:

API:

  • private



23
24
25
# File 'lib/any_cache/adapters/active_support_naive_store/decrement.rb', line 23

def call(key, amount = DEFAULT_AMOUNT, expires_in: NO_EXPIRATION_TTL)
  expires_in ? decr_and_expire(key, amount, expires_in) : decr_existing(key, amount)
end