Class: HTTParty::Cache::Store::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/httparty/cache/store/abstract.rb

Overview

Cache store

Direct Known Subclasses

Jekyll, Memory, Redis

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsHash (readonly)

Returns:

  • (Hash)


9
10
11
# File 'lib/httparty/cache/store/abstract.rb', line 9

def options
  @options
end

Instance Method Details

#clearObject

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/httparty/cache/store/abstract.rb', line 42

def clear
  raise NotImplementedError
end

#delete(key) ⇒ Object

Returns nil.

Parameters:

  • :key (String)

Returns:

  • nil

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/httparty/cache/store/abstract.rb', line 26

def delete(key)
  raise NotImplementedError
end

#get(key) ⇒ Response?

Parameters:

  • :key (String)

Returns:

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/httparty/cache/store/abstract.rb', line 13

def get(key)
  raise NotImplementedError
end

#getset(key) { ... } ⇒ Object

Parameters:

  • :key (String)

Yields:

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/httparty/cache/store/abstract.rb', line 32

def getset(key, &block)
  raise NotImplementedError
end

#key?(key) ⇒ Boolean

Parameters:

  • :key (String)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


38
39
40
# File 'lib/httparty/cache/store/abstract.rb', line 38

def key?(key)
  raise NotImplementedError
end

#marshal_dumpObject



46
47
48
49
50
51
# File 'lib/httparty/cache/store/abstract.rb', line 46

def marshal_dump
  [
    self.class.name,
    options || {}
  ]
end

#marshal_load(array) ⇒ Object



53
54
55
# File 'lib/httparty/cache/store/abstract.rb', line 53

def marshal_load(array)
  Object.const_get(array.first).new(**array.last)
end

#set(key, response) ⇒ Response

Parameters:

Returns:

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/httparty/cache/store/abstract.rb', line 20

def set(key, response)
  raise NotImplementedError
end