Sha256: 80439930cd0fc8ad133d2b6101a660e67a14181c004b5c4b5e02a20be0578305
Contents?: true
Size: 880 Bytes
Versions: 8
Compression:
Stored size: 880 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Common module Plugins module CachesReturnValue class Middleware < MethodChainMiddleware intended_for any_method, scope: any_scope, entity: any_entity ## # @return [Object] Can be any type. # def next(...) cache.fetch(key) { chain.next(...) } end private ## # @return [ConvenientService::Support::Cache] # def cache @cache ||= entity.internals.cache end ## # @return [ConvenientService::Support::Cache::Entities::Key] # def key @key ||= cache.keygen(:return_values, method, *next_arguments.args, **next_arguments.kwargs, &next_arguments.block) end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems