You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cacheable is a gem which adds method caching in Ruby following an [aspect-oriented programming (AOP)](https://en.wikipedia.org/wiki/Aspect-oriented_programming) paradigm. Its core goals are:
6
10
7
11
* ease of use (method annotation)
@@ -131,7 +135,7 @@ Fetching data from GitHub
131
135
132
136
#### Default
133
137
134
-
By default, Cacheable will construct key a key in the format `[cache_key || class_name, method_name]` without using method arguments.
138
+
By default, Cacheable will construct a key in the format `[cache_key || class_name, method_name]` without using method arguments.
135
139
136
140
If the object responds to `cache_key` its return value will be the first element in the array. `ActiveRecord` provides [`cache_key`](https://api.rubyonrails.org/classes/ActiveRecord/Integration.html#method-i-cache_key) but it can be added to any Ruby object or overwritten. If the object does not respond to it, the name of the class will be used instead. The second element will be the name of the method as a symbol.
Cacheable.cache_adapter.fetch(__send__(method_names[:key_format_method_name], *args),opts[:cache_options])do# rubocop:disable Lint/UselessDefaultValueArgument -- not Hash#fetch; second arg is cache options (e.g. expires_in) passed to the adapter
0 commit comments