Class: Profiler::Storage::BaseStore

Inherits:
Object
  • Object
show all
Defined in:
lib/profiler/storage/base_store.rb

Direct Known Subclasses

FileStore, MemoryStore, RedisStore, SqliteStore

Instance Method Summary collapse

Instance Method Details

#cleanup(older_than: 24 * 60 * 60) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/profiler/storage/base_store.rb', line 18

def cleanup(older_than: 24 * 60 * 60)
  raise NotImplementedError, "#{self.class} must implement #cleanup"
end

#clear(type: nil) ⇒ Object

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/profiler/storage/base_store.rb', line 36

def clear(type: nil)
  raise NotImplementedError, "#{self.class} must implement #clear"
end

#delete(token) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/profiler/storage/base_store.rb', line 32

def delete(token)
  raise NotImplementedError, "#{self.class} must implement #delete"
end

#exists?(token) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/profiler/storage/base_store.rb', line 22

def exists?(token)
  !load(token).nil?
rescue
  false
end

#find_by_parent(parent_token) ⇒ Object

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/profiler/storage/base_store.rb', line 28

def find_by_parent(parent_token)
  raise NotImplementedError, "#{self.class} must implement #find_by_parent"
end

#list(limit: 50, offset: 0) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/profiler/storage/base_store.rb', line 14

def list(limit: 50, offset: 0)
  raise NotImplementedError, "#{self.class} must implement #list"
end

#load(token) ⇒ Object

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/profiler/storage/base_store.rb', line 10

def load(token)
  raise NotImplementedError, "#{self.class} must implement #load"
end

#save(token, profile) ⇒ Object

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/profiler/storage/base_store.rb', line 6

def save(token, profile)
  raise NotImplementedError, "#{self.class} must implement #save"
end