lib/fastly/service.rb in fastly-1.3.0 vs lib/fastly/service.rb in fastly-1.4.0

- old
+ new

@@ -67,12 +67,12 @@ end # Purge anything with the specific key from the given service. # # See README.md for examples of purging - def purge_by_key(key) + def purge_by_key(key, soft=false) require_api_key! - fetcher.client.post("#{Service.get_path(id)}/purge/#{key}") + fetcher.client.post("#{Service.get_path(id)}/purge/#{key}", soft ? { headers: { 'Fastly-Soft-Purge' => "1"} } : {}) end # Get a sorted array of all the versions that this service has had. def versions @versions.map { |v| Version.new(v, fetcher) }.sort { |a, b| a.number.to_i <=> b.number.to_i }