gpd-request 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/gpd-request.rb +17 -1
  2. metadata +2 -2
data/lib/gpd-request.rb CHANGED
@@ -34,11 +34,27 @@ class GPDRequest
34
34
  end
35
35
  end
36
36
 
37
- def delete(uri, form_data={})
37
+ def delete(arg, form_data={})
38
+ methods = {String: :string_delete, Array: :array_delete}
39
+ send (methods[arg.class.to_s.to_sym]), arg, form_data
40
+ end
41
+
42
+ def string_delete(uri, form_data={})
38
43
  request(uri) do |url|
39
44
  req = Net::HTTP::Delete.new(url.path, @headers)
40
45
  req.set_form_data form_data unless form_data.empty?
41
46
  req
42
47
  end
43
48
  end
49
+
50
+ def array_delete(a, form_data={})
51
+ a.map do |url|
52
+ request(uri) do |url|
53
+ req = Net::HTTP::Delete.new(url.path, @headers)
54
+ req.set_form_data form_data unless form_data.empty?
55
+ req
56
+ end
57
+ end
58
+ end
59
+
44
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpd-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-17 00:00:00 +00:00
12
+ date: 2010-04-10 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15