Module: MongoMapper::Plugins::AttributeCache::InstanceMethods

Defined in:
lib/mongo_mapper_ext/mongo_mapper/plugins/attribute_cache.rb

Instance Method Summary collapse

Instance Method Details

#cacheObject



5
6
7
# File 'lib/mongo_mapper_ext/mongo_mapper/plugins/attribute_cache.rb', line 5

def cache
  @cache ||= {}
end

#clear_cacheObject



9
10
11
# File 'lib/mongo_mapper_ext/mongo_mapper/plugins/attribute_cache.rb', line 9

def clear_cache
  @cache = {}
end

#reloadObject



13
14
15
16
# File 'lib/mongo_mapper_ext/mongo_mapper/plugins/attribute_cache.rb', line 13

def reload
  @cache.clear if @cache
  super
end