diff --git a/lib/cache_crispies/base.rb b/lib/cache_crispies/base.rb index 23262ac..e3e43e9 100644 --- a/lib/cache_crispies/base.rb +++ b/lib/cache_crispies/base.rb @@ -178,6 +178,14 @@ def self.file_hashes ).uniq.sort end + # Sets a method or Proc to transform keys by + # + # @param proc [Proc] a Proc to execute on serializable keys + # @return [Proc] a Proc to execute on the keys + def self.transform_keys(proc = nil) + @transform_keys ||= proc + end + private def self.file_hash @@ -252,16 +260,6 @@ def self.merge(attribute = nil, with: nil) end private_class_method :merge - # Sets a method or Proc to transform keys by - # - # @param proc [Proc] a Proc to execute on serializable keys - # @return [Proc] a Proc to execute on the keys - def self.transform_keys(proc = nil) - return @transform_keys if @transform_keys.present? - - @transform_keys = proc - end - # Transforms an attribute key using a specified Proc # # @param key [String] the key for an attribute