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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0451ff64039dd738d985b64b040969c3fb544385
4
- data.tar.gz: 1801bea21f4c2b1f94877e36d7ec455a5309bf37
3
+ metadata.gz: 2bd26e1e910d34a566ed4795698a4ecd9e6682c2
4
+ data.tar.gz: 0c728472c605c3c30441e45d9294eb1c636b91c5
5
5
  SHA512:
6
- metadata.gz: 37e7d17bd520699d9c94ad1d1818248b3a0a945ddc01a3dba29eaaf934a2783e7ddcc88b3122574450bf7dcbd2adf96740817dc666543a436642b8e95ef43215
7
- data.tar.gz: a277f0488238e27c771f1e377699d8d6e667e37663a55043518ecd9eb9257edc934e8b73ef13ecd154ff16b419602c55b27a65b9b08b45cbeb6dc42651b8a7f3
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
@@ -1,5 +1,5 @@
1
1
  module Outbrain
2
2
  module Api
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
@@ -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.8
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-02 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday