Class: AnyCache::Adapters::Delegator Private

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

Direct Known Subclasses

ActiveSupportNaiveStore

Instance Attribute Summary

Attributes inherited from Basic

#driver

Class Method Summary collapse

Methods inherited from Basic

#cleanup, #clear, #decrement, #delete, #delete_matched, #exist?, #expire, #fetch, #fetch_multi, #increment, #initialize, #persist, #read, #read_multi, #write, #write_multi

Methods included from Dumper::InterfaceAccessMixin

#detransform_pairset, #detransform_value, #transform_pairset, #transform_value

Constructor Details

This class inherits a constructor from AnyCache::Adapters::Basic

Class Method Details

.supported_driver?(driver) ⇒ Boolean

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.

rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize

Parameters:

  • driver (Object)

Returns:

  • (Boolean)

Since:

  • 0.1.0



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/any_cache/adapters/delegator.rb', line 14

def supported_driver?(driver)
  driver.respond_to?(:read) &&
  driver.respond_to?(:read_multi) &&
  driver.respond_to?(:write) &&
  driver.respond_to?(:write_multi) &&
  driver.respond_to?(:fetch) &&
  driver.respond_to?(:fetch_multi) &&
  driver.respond_to?(:delete) &&
  driver.respond_to?(:delete_matched) &&
  driver.respond_to?(:increment) &&
  driver.respond_to?(:decrement) &&
  driver.respond_to?(:expire) &&
  driver.respond_to?(:persist) &&
  driver.respond_to?(:clear) &&
  driver.respond_to?(:cleanup) &&
  driver.respond_to?(:exist?)
end