vidsy-data-api 0.2.0 → 0.3.0

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: 3dd50e235e37f091cf6a2042467970d1ab7a8798
4
- data.tar.gz: a4405ca330ff8c5f08a132ec4f4c9a9ee9d5d57c
3
+ metadata.gz: 93f40e4e9c553a989d40f3c585dbd3e1cb57f72c
4
+ data.tar.gz: b379b58644a2bfdc978dc1d8da777e306d004ec1
5
5
  SHA512:
6
- metadata.gz: 016d2184b1cba28e16c4b602e588f6dd193a78a4a958ec409c38e4bd262367ca04f85d71c18b203d93e0f45389c9d118176194a6509995ee1ff51b0080704034
7
- data.tar.gz: 94b1e76f3540c9386abd3b0e2aa913d2e4f449322989d221e266e1fcebbbb10d123cda75c3be51a3c3b48fd1ed2957f213602f6fdd7c9d641fa20a31e44ddf5f
6
+ metadata.gz: 170bc521276ffb37cf0ea1cf64ad478546ab29a520e4dae31768e78cdfefd679956fd4c7332e213a4e3b1023265e5ce457c5ce6e8929c7e020454fe44a958e7b
7
+ data.tar.gz: ec0362660160e90858633f58db0e130c7d03648857bfae9b6c679a3bc4be18afc09ba33b9a7f998e3495601cc614cf108db940f22c34c77fdb411b737fb91093
@@ -4,10 +4,32 @@ module Vidsy
4
4
  module Data
5
5
  module API
6
6
  class Brand < Client
7
+ def initialize(id = nil)
8
+ @id = id
9
+ end
10
+
11
+ def challenges
12
+ raise(ArgumentError, "ID not set for Brand") if id.nil?
13
+ challenges = get "#{routes.brand}/#{id}/#{routes.challenges}"
14
+ challenges.size == 0 ? nil : challenges
15
+ end
16
+
7
17
  def self.all
8
18
  brands = get "#{routes.brands}"
9
19
  brands.size == 0 ? nil : brands
10
20
  end
21
+
22
+ private
23
+
24
+ attr_reader :id
25
+
26
+ def get(path)
27
+ self.class.superclass.method(:get).call path
28
+ end
29
+
30
+ def routes
31
+ self.class.superclass.method(:routes).call
32
+ end
11
33
  end
12
34
  end
13
35
  end
@@ -1,7 +1,7 @@
1
1
  module Vidsy
2
2
  module Data
3
3
  module API
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidsy-data-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Revett