Module: Perforated

Extended by:
Perforated
Included in:
Perforated
Defined in:
lib/perforated.rb,
lib/perforated/cache.rb,
lib/perforated/version.rb,
lib/perforated/strategy.rb,
lib/perforated/rebuilder.rb,
lib/perforated/compatibility/fetch_multi.rb

Defined Under Namespace

Modules: Compatibility, Strategy Classes: Cache, Rebuilder

Constant Summary collapse

VERSION =
'0.10.1'

Instance Method Summary collapse

Instance Method Details

#cacheObject



16
17
18
# File 'lib/perforated.rb', line 16

def cache
  @cache ||= ActiveSupport::Cache::MemoryStore.new
end

#cache=(new_cache) ⇒ Object



12
13
14
# File 'lib/perforated.rb', line 12

def cache=(new_cache)
  @cache = new_cache
end

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Perforated)

    the object that the method was called on



28
29
30
# File 'lib/perforated.rb', line 28

def configure
  yield self
end

#jsonObject



24
25
26
# File 'lib/perforated.rb', line 24

def json
  @json ||= JSON
end

#json=(new_json) ⇒ Object



20
21
22
# File 'lib/perforated.rb', line 20

def json=(new_json)
  @json = new_json
end

#new(*args) ⇒ Object



8
9
10
# File 'lib/perforated.rb', line 8

def new(*args)
  Perforated::Cache.new(*args)
end

#reset!Object



32
33
34
35
# File 'lib/perforated.rb', line 32

def reset!
  @cache = nil
  @json  = nil
end