Class: AnyCache::Adapters::ActiveSupportNaiveStore::Increment Private

Inherits:
Operation
  • Object
show all
Defined in:
lib/any_cache/adapters/active_support_naive_store/increment.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

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.

Returns:

  • (Integer)

Since:

  • 0.1.0

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.

Parameters:

  • key (String)
  • amount (Integer, Float) (defaults to: DEFAULT_AMOUNT)
  • expires_in (Hash) (defaults to: NO_EXPIRATION_TTL)

    a customizable set of options

Options Hash (expires_in:):

  • (NilClass, Integer)

Returns:

  • (Integer, Float)

Since:

  • 0.1.0



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

def call(key, amount = DEFAULT_AMOUNT, expires_in: NO_EXPIRATION_TTL)
  expires_in ? incr_and_expire(key, amount, expires_in) : incr_existing(key, amount)
end