Class: ConvenientService::Support::Cache::Entities::Caches::Base

Inherits:
Object
  • Object
show all
Includes:
AbstractMethod
Defined in:
lib/convenient_service/support/cache/entities/caches/base.rb

Direct Known Subclasses

Array, Hash

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AbstractMethod

abstract_method

Constructor Details

#initializevoid



58
59
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 58

def initialize
end

Class Method Details

.keygenConvenientService::Support::Cache::Entities::Key



15
16
17
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 15

def keygen(...)
  Entities::Key.new(...)
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


103
104
105
106
107
108
109
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 103

def ==(other)
  return unless other.instance_of?(self.class)

  return false if store != other.store

  true
end

#[]Object

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



74
75
76
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 74

def [](...)
  read(...)
end

#[]=Object

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



84
85
86
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 84

def []=(...)
  write(...)
end

#clearConvenientService::Support::Cache::Enitities::Caches::Base

Returns:

  • (ConvenientService::Support::Cache::Enitities::Caches::Base)


53
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 53

abstract_method :clear

#deleteObject?

Returns Can be any type.

Returns:

  • (Object, nil)

    Can be any type.



48
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 48

abstract_method :delete

#empty?Boolean

Returns:

  • (Boolean)


23
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 23

abstract_method :empty?

#exist?Boolean

Returns:

  • (Boolean)


28
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 28

abstract_method :exist?

#fetchObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



43
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 43

abstract_method :fetch

#keygenConvenientService::Support::Cache::Entities::Key



64
65
66
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 64

def keygen(...)
  self.class.keygen(...)
end

#readObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



33
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 33

abstract_method :read

#scope(key) ⇒ ConvenientService::Support::Cache::Entities::Caches::Base

Parameters:

  • key (Object)

    Can be any type.

Returns:



95
96
97
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 95

def scope(key)
  fetch(key) { self.class.new }
end

#writeObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



38
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 38

abstract_method :write