active_campaign 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_campaign/client.rb +12 -1
- data/lib/active_campaign/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 104df53715ce913f6d497ae4fe571eefe26e840e
|
4
|
+
data.tar.gz: 6f0977e741a5147e473280012d2e34de5829283d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 531e1b7629b4e1a891f6e1c6042c919745f5a2e05cbc305218c78db0fb40a5841b4bfd1197911aea2d7d9ea34a1fb6c08d0e837973a4494c98a7ad40068f4978
|
7
|
+
data.tar.gz: 890848b6df5847cf90f196514aefde062e70fd3334b1433e7981c4324fe5b201d5551827ea4e9a3afeed23f72909dafa050cdfc29ffe30348ce5491060784509
|
@@ -60,7 +60,7 @@ module ActiveCampaign
|
|
60
60
|
request = HTTPI::Request.new :url => File.join(api_endpoint, api_path)
|
61
61
|
request.headers = {"User-Agent" => user_agent}
|
62
62
|
request.query = query(method, api_method, options)
|
63
|
-
request.body =
|
63
|
+
request.body = body(method, api_method, options)
|
64
64
|
|
65
65
|
request
|
66
66
|
end
|
@@ -80,6 +80,17 @@ module ActiveCampaign
|
|
80
80
|
q
|
81
81
|
end
|
82
82
|
|
83
|
+
def body(method, api_method, options = {})
|
84
|
+
return nil unless method == :post
|
85
|
+
|
86
|
+
fields = options.delete(:fields){ Hash.new }
|
87
|
+
options[:field] = fields.inject({}) do |hash, (k,v)|
|
88
|
+
hash.merge("%#{k}%,0" => v)
|
89
|
+
end
|
90
|
+
|
91
|
+
options.to_query
|
92
|
+
end
|
93
|
+
|
83
94
|
def normalize(response)
|
84
95
|
keys, values = keys_values(response)
|
85
96
|
|