Class: MetalArchives::Cache::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/metal_archives/cache/base.rb

Overview

Generic cache interface

Direct Known Subclasses

Memory, Null, Redis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
# File 'lib/metal_archives/cache/base.rb', line 11

def initialize(options = {})
  @options = options

  validate!
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/metal_archives/cache/base.rb', line 9

def options
  @options
end

Instance Method Details

#[]Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/metal_archives/cache/base.rb', line 19

def []
  raise NotImplementedError
end

#[]=(_key, _value) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/metal_archives/cache/base.rb', line 23

def []=(_key, _value)
  raise NotImplementedError
end

#clearObject

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/metal_archives/cache/base.rb', line 27

def clear
  raise NotImplementedError
end

#delete(_key) ⇒ Object

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/metal_archives/cache/base.rb', line 35

def delete(_key)
  raise NotImplementedError
end

#include?(_key) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/metal_archives/cache/base.rb', line 31

def include?(_key)
  raise NotImplementedError
end

#validate!Object



17
# File 'lib/metal_archives/cache/base.rb', line 17

def validate!; end