fanforce 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fanforce/main.rb +15 -0
- data/lib/fanforce/version.rb +1 -1
- metadata +1 -1
data/lib/fanforce/main.rb
CHANGED
@@ -36,6 +36,21 @@ class Fanforce
|
|
36
36
|
"#{url}?#{to_query_string(req_params)}"
|
37
37
|
end
|
38
38
|
|
39
|
+
def get_curl_command(method, path, req_params={})
|
40
|
+
case method
|
41
|
+
when :get
|
42
|
+
"curl \"#{path}?#{to_param(req_params)}\""
|
43
|
+
when :post
|
44
|
+
"curl -X POST -d \"#{to_param(req_params)}\" #{path}"
|
45
|
+
when :put
|
46
|
+
"curl -X PUT -d \"#{to_param(req_params)}\" #{path.to_json}"
|
47
|
+
when :delete
|
48
|
+
"curl --request DELETE \"#{path}?#{to_param(req_params)}\""
|
49
|
+
else
|
50
|
+
raise 'Unknown request method'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
39
54
|
def post(path, req_params={})
|
40
55
|
url = complete_url(path)
|
41
56
|
req_params = apply_auth(req_params)
|
data/lib/fanforce/version.rb
CHANGED