Sha256: cf3bf7ede6f71e510d98b379cb02bbddcc7fb2c283776f070f522a2a0e0ee000
Contents?: true
Size: 938 Bytes
Versions: 2
Compression:
Stored size: 938 Bytes
Contents
# frozen_string_literal: true require 'cloudflair/communication' module Cloudflair class PurgeCache attr_reader :zone_id include Cloudflair::Communication def initialize(zone_id) @zone_id = zone_id end ## # @param purge_everything must be set to true def everything(purge_everything) resp = connection.post(path) { |req| req.body = { purge_everything: purge_everything } } response resp self end ## # @param [Hash] cache_identifier Consists of :files and :tags, which are String Arrays themselves. Sample: <code>{files: ['https://foo.bar/index.htmll'], tags: ['css','js']} def selective(cache_identifier = {}) return self if cache_identifier.nil? || cache_identifier.empty? resp = connection.post(path) { |req| req.body = cache_identifier } response resp self end def path "zones/#{zone_id}/purge_cache" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cloudflair-0.4.0 | lib/cloudflair/api/zone/purge_cache.rb |
cloudflair-0.3.0 | lib/cloudflair/api/zone/purge_cache.rb |