In general, what is better for a global cache: a global, constant, or instance class variable?
Here is an example of each of them:
module Foo $FOO_CACHE = {} def self.access_to_cache $FOO_CACHE end end module Foo CACHE = {} def self.access_to_cache CACHE end end module Foo @cache = {} def self.access_to_cache @cache end end
source share