Class: Rack::Cache::Purge::Purger

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/cache/purge/purger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Purger

Returns a new instance of Purger.



10
11
12
# File 'lib/rack/cache/purge/purger.rb', line 10

def initialize(env)
  @env = env
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



8
9
10
# File 'lib/rack/cache/purge/purger.rb', line 8

def env
  @env
end

Instance Method Details

#purge(uris) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rack/cache/purge/purger.rb', line 14

def purge(uris)
  normalize_uris(uris).map do |uri|
    key = key_for(uri)
    metastore.purge(key)
    entitystore.purge(key)
  end
end