outbrain-api 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/outbrain/api/campaign.rb +5 -1
- data/lib/outbrain/api/version.rb +1 -1
- data/lib/outbrain/request.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd26e1e910d34a566ed4795698a4ecd9e6682c2
|
4
|
+
data.tar.gz: 0c728472c605c3c30441e45d9294eb1c636b91c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 468b3f8cac5690a88e0d2a6fa49f95833c713debe9e2b76a8446942886f8efaced1ea1f7fb15fd6020535c2615da8af980241dac109d05690b76bf1cc548cd98
|
7
|
+
data.tar.gz: 52479b97ae8c105f4598f7a9e1ff4a9771683ae47e7c91d39e4f822bc62d8be3c8d523b1989564e285c3b5832b4fa577b456cd4cecefd755a7edf59a18cfccd4
|
@@ -10,6 +10,10 @@ module Outbrain
|
|
10
10
|
def self.find(campaign_id)
|
11
11
|
Request.find(PATH, campaign_id, { as: self })
|
12
12
|
end
|
13
|
+
|
14
|
+
def self.update(campaign_id, attributes)
|
15
|
+
Request.update(PATH, campaign_id, {as: self, attributes: attributes })
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
15
|
-
end
|
19
|
+
end
|
data/lib/outbrain/api/version.rb
CHANGED
data/lib/outbrain/request.rb
CHANGED
@@ -54,5 +54,19 @@ module Outbrain
|
|
54
54
|
a
|
55
55
|
end
|
56
56
|
end
|
57
|
+
|
58
|
+
def self.update(resource_path, id, options={})
|
59
|
+
attributes = options.fetch(:attributes, {})
|
60
|
+
response = api.put("/amplify/#{api_version}/#{resource_path}/#{id}", attributes.to_json)
|
61
|
+
json_body = JSON.parse(response.body)
|
62
|
+
|
63
|
+
if response.status == 200
|
64
|
+
options[:as].new(json_body)
|
65
|
+
else
|
66
|
+
a = options[:as].new
|
67
|
+
a.errors.push(json_body)
|
68
|
+
a
|
69
|
+
end
|
70
|
+
end
|
57
71
|
end
|
58
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outbrain-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Blanchet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|