Skip to content

Commit

Permalink
purge api
Browse files Browse the repository at this point in the history
  • Loading branch information
dlitvakb committed Mar 7, 2013
1 parent 337090a commit 8dcb524
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.2.4
0.2.5
25 changes: 25 additions & 0 deletions lib/netdnarws.rb
Expand Up @@ -100,5 +100,30 @@ def delete uri, data={}, options={}
options[:body] = false
self._response_as_json 'delete', uri, options, data
end

def purge zone_id, file_or_files=nil
if file_or_files.respond_to? :each
responses = Hash.new

file_or_files.each { |e|
responses[e] = self.delete(
"/zones/pull.json/#{zone_id}/cache",
{'file' => e},
:debug_json => true
)
}
return responses
end


unless file_or_files.nil?
return self.delete(
"/zones/pull.json/#{zone_id}/cache",
{'file' => file_or_files}
)
end

self.delete("/zones/pull.json/#{zone_id}/cache")
end
end
end
2 changes: 1 addition & 1 deletion lib/netdnarws/version.rb
@@ -1,3 +1,3 @@
module NetDNARWS
VERSION = "0.2.4"
VERSION = "0.2.5"
end

0 comments on commit 8dcb524

Please sign in to comment.