Module: ActiveMemoize::Shared
Instance Method Summary collapse
Instance Method Details
#cache ⇒ Object
8 9 10 |
# File 'lib/active_memoize/shared.rb', line 8 def cache @cache ||= {} end |
#key(method_name, method_args) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/active_memoize/shared.rb', line 12 def key(method_name, method_args) return method_name.to_s if method_args.empty? method_sha1 = Digest::SHA1.hexdigest(method_args.to_s) "#{method_name}:#{method_sha1}" end |