outbrain-api 0.2.0 → 0.2.1

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: 96cd2e1561931a5785dcd475183cbc2916e6a192
4
- data.tar.gz: 9caf4b1445bfd234efda891b37c1c27fa2e46f28
3
+ metadata.gz: 0cd2fe224424c93b786e444ba26d293b4e447d39
4
+ data.tar.gz: bb4aeebc8321eb986d2317b1ab3156da28ddc5ff
5
5
  SHA512:
6
- metadata.gz: f9716a4f255e1059869ffc7f43fcf0e6d8b4088cf4fe5bd00d023d4bc251882138cb0a3dfb1709d5c26666d6b80d1fc0dc23d0c2165e2bebd89e2b9bba85bfe6
7
- data.tar.gz: 027a41b6b3ee7c8ea716326a91baee9f1843abfba956646c10e889d8d831d71f2a34e087114368284197abcdc822b6ec857d2c617e3af39243b2be86dd212b83
6
+ metadata.gz: 27ddbc75d3af696f635c0bad849958f8a87db321c88dbd2e5354b96af59acb1717aa9d13aca70e83b5ace4f92241dcafcbb8a8e9a3dc5b83e86419cb47511bb1
7
+ data.tar.gz: 773f0fe4f03758e7269827d876db93150a90ae0afb8b1c07c2d696880eed4e38f6e3af25061a9912d3b331b259cac6dd599bc106cb360254284ddcdd2af2fa25
@@ -2,15 +2,20 @@ module Outbrain
2
2
  module Api
3
3
  class Relation
4
4
  include Enumerable
5
- attr_accessor :relations, :totalDataCount, :overAllMetrics, :aggregatedBy
5
+ attr_accessor :relations, :errors, :totalDataCount, :overAllMetrics, :aggregatedBy
6
6
 
7
7
  def initialize(options = {})
8
8
  @relations = []
9
+ @errors = []
9
10
  end
10
11
 
11
12
  def each &block
12
13
  @relations.each{|relation| block.call(relation) }
13
14
  end
15
+
16
+ def any?
17
+ relations.any?
18
+ end
14
19
  end
15
20
  end
16
21
  end
@@ -1,5 +1,5 @@
1
1
  module Outbrain
2
2
  module Api
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -17,7 +17,9 @@ module Outbrain
17
17
  r.relations = json_body[resource_name].map{ |obj| options[:as].new(obj) }
18
18
  end
19
19
  else
20
- [json_body]
20
+ Outbrain::Api::Relation.new.tap do |r|
21
+ r.errors << json_body
22
+ end
21
23
  end
22
24
  end
23
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outbrain-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Blanchet