Module: MongoMapper::Plugins::AttributesCache::InstanceMethods

Defined in:
lib/mongo_mapper_ext/plugins/attributes_cache.rb

Instance Method Summary collapse

Instance Method Details

#cacheObject



6
7
8
# File 'lib/mongo_mapper_ext/plugins/attributes_cache.rb', line 6

def cache
  @cache ||= {}
end

#clear_cacheObject



10
11
12
# File 'lib/mongo_mapper_ext/plugins/attributes_cache.rb', line 10

def clear_cache
  @cache = {}
end

#reloadObject



14
15
16
17
# File 'lib/mongo_mapper_ext/plugins/attributes_cache.rb', line 14

def reload
  @cache.clear if @cache
  super
end