Class: CacheStore

Inherits:
Object
  • Object
show all
Defined in:
brew/Library/Homebrew/cache_store.rb

Overview

CacheStore provides methods to mutate and fetch data from a persistent storage mechanism.

Direct Known Subclasses

DescriptionCacheStore, LinkageCacheStore

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ nil

Parameters:



119
120
121
# File 'brew/Library/Homebrew/cache_store.rb', line 119

def initialize(database)
  @database = database
end

Instance Method Details

#delete!Object

This method is abstract.

Deletes data from the cache based on a condition defined in a concrete class

Raises:

  • (NotImplementedError)


142
143
144
# File 'brew/Library/Homebrew/cache_store.rb', line 142

def delete!(*)
  raise NotImplementedError
end

#fetchObject

This method is abstract.

Fetches cached values in persistent storage according to the type of data stored

Raises:

  • (NotImplementedError)


135
136
137
# File 'brew/Library/Homebrew/cache_store.rb', line 135

def fetch(*)
  raise NotImplementedError
end

#update!Object

This method is abstract.

Inserts new values or updates existing cached values to persistent storage mechanism

Raises:

  • (NotImplementedError)


127
128
129
# File 'brew/Library/Homebrew/cache_store.rb', line 127

def update!(*)
  raise NotImplementedError
end