Class: CacheManager::Stats

Inherits:
Object
  • Object
show all
Defined in:
app/models/cache_manager/stats.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStats

Returns a new instance of Stats.



5
6
7
# File 'app/models/cache_manager/stats.rb', line 5

def initialize
  @klass = Rails.cache.class.to_s
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



3
4
5
# File 'app/models/cache_manager/stats.rb', line 3

def klass
  @klass
end

Class Method Details

.allObject



10
11
12
# File 'app/models/cache_manager/stats.rb', line 10

def all
  new.all
end

Instance Method Details

#allObject



15
16
17
18
19
20
21
22
# File 'app/models/cache_manager/stats.rb', line 15

def all
  case @klass
  when 'ActiveSupport::Cache::FileStore'
    {}
  else
    Rails.cache.stats
  end
end