Class: ApiBlueprint::Cache

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/api-blueprint/cache.rb

Instance Method Summary collapse

Instance Method Details

#exist?(id) ⇒ Boolean



7
8
9
# File 'lib/api-blueprint/cache.rb', line 7

def exist?(id)
  false
end

#generate_cache_key(klass, options) ⇒ Object



19
20
21
22
23
# File 'lib/api-blueprint/cache.rb', line 19

def generate_cache_key(klass, options)
  options = options.clone.except :body
  options_digest = Digest::MD5.hexdigest Marshal::dump(options.to_s.chars.sort.join)
  "#{key}:#{klass&.name}:#{options_digest}"
end

#read(id) ⇒ Object



11
12
13
# File 'lib/api-blueprint/cache.rb', line 11

def read(id)
  false
end

#write(id, data, options) ⇒ Object



15
16
17
# File 'lib/api-blueprint/cache.rb', line 15

def write(id, data, options)
  data
end