lib/ocean/api_resource.rb
def invalidate(avoid_self=false)
    self.class.invalidate
    resource_name = self.class.name.pluralize.underscore
    varnish_invalidate_member.each do |thing|
      if thing.is_a?(String)
        Api.ban "/v[0-9]+/#{resource_name}/#{self.id}#{thing}" if !avoid_self
      else
        Api.ban "/v[0-9]+/#{thing.call(self)}"
      end
    end
  end
#
# Invalidate the member and all its collections in Varnish using a +BAN+ requests to all
# caches in the Chef environment. The +BAN+ request are done in parallel.
# The number of +BAN+ requests, and the exact +URI+ composition in each request,
# is determined by the +invalidate_member:+ arg to the +ocean_resource_model+
# declaration in the model.
#
# The optional arg +avoid_self+, if true (the default is false), avoids invalidating
# the basic resource itself: only its derived collections are invalidated. This is useful
# when instantiating a new resource.
#
Invalidate the member and all its collections in Varnish using a +BAN+ requests to all
caches in the Chef environment. The +BAN+ request are done in parallel.

The optional arg +avoid_self+, if true (the default is false), avoids invalidating
the basic resource itself: only its derived collections are invalidated. This is useful
when instantiating a new resource.
Invalidate the member and all its collections in Varnish using a + BAN + requests to all caches in the Chef environment . The + BAN + request are done in parallel . The optional arg + avoid_self + if true ( the default is false ) avoids invalidating the basic resource itself : only its derived collections are invalidated . This is useful when instantiating a new resource .
def invalidate(avoid_self=false)
    self.class.invalidate
    resource_name = self.class.name.pluralize.underscore
    varnish_invalidate_member.each do |thing|
      if thing.is_a?(String)
        Api.ban "/v[0-9]+/#{resource_name}/#{self.id}#{thing}" if !avoid_self
      else
        Api.ban "/v[0-9]+/#{thing.call(self)}"
      end
    end
  end
def invalidate ( avoid_self = false ) self . class . invalidate resource_name = self . class . name . pluralize . underscore varnish_invalidate_member . each do | thing | if thing . is_a? ( String ) Api . ban "/v[0-9]+/#{resource_name}/#{self.id}#{thing}" if ! avoid_self else Api . ban "/v[0-9]+/#{thing.call(self)}" end end end
Invalidate the member and all its collections in Varnish using a +BAN+ requests to all
caches in the Chef environment.
Invalidate the member and all its collections in Varnish using a + BAN + requests to all caches in the Chef environment .
avoid_self