wes-data-api 2.3.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9b52a14035dee65b5db2838a4f30f8208e74d10
4
- data.tar.gz: 903d38e12cff42e246b0059b4ed330c0812e254e
3
+ metadata.gz: 5d3b20444adc11e30733f69977781989efd9c706
4
+ data.tar.gz: d07c857738028ab4b9cffdc663a2f79a3ffdcd7f
5
5
  SHA512:
6
- metadata.gz: 5d6c70f4346372bba644f5bb2b7ecdecb214a15279d34d73cec824d398cb2d01973f5c4eb7c91b5eb08f33aee8c38795d7259740687dd2fb08af9945c491a7d8
7
- data.tar.gz: 81fac74d73011b6bd18a46d5375584bba1e37c43a97cc5ec31f930c2e5174aad5c83c0dac21689b42a171fa9873c9a48e92d810f69d7ce5e23210de83bd28bad
6
+ metadata.gz: abe0002159e76a935cbae98197ff38a7bd7596affebcb66b9436e3893791bc23e87f847cd50ba467ed19d8386b7ac10d977c32ba1784641462b527fc01318912
7
+ data.tar.gz: 6f3ae4d07ad6dc5a0339d12771ad408bfab4475e0eef58417e5d14476b0f5543054ee1f4eaf220406e68a684b319612268d2bfcfbab07b3900a9df77e9777dac
@@ -5,28 +5,29 @@ module Wes
5
5
  module Data
6
6
  module API
7
7
  class Challenge
8
- def initialize(id = nil)
9
- @id = id
10
- end
8
+ attr_reader :attributes
11
9
 
12
- def self.all
13
- new.all
10
+ def initialize(attributes)
11
+ @attributes = attributes
14
12
  end
15
13
 
16
- def self.closed
17
- new.closed
18
- end
14
+ class << self
15
+ def client
16
+ Client.new
17
+ end
19
18
 
20
- def self.drafts
21
- new.drafts
22
- end
19
+ def configuration
20
+ Configuration
21
+ end
23
22
 
24
- def self.find(id)
25
- new.find id
26
- end
23
+ def find(id)
24
+ attributes = client.get("#{routes.challenge}/#{id}").first
25
+ new(attributes)
26
+ end
27
27
 
28
- def self.open
29
- new.open
28
+ def routes
29
+ configuration.routes
30
+ end
30
31
  end
31
32
 
32
33
  def all
@@ -41,10 +42,6 @@ module Wes
41
42
  client.get "#{routes.challenges}/drafts"
42
43
  end
43
44
 
44
- def find(id)
45
- client.get("#{routes.challenge}/#{id}").first
46
- end
47
-
48
45
  def open
49
46
  client.get "#{routes.challenges}/open"
50
47
  end
@@ -56,18 +53,16 @@ module Wes
56
53
 
57
54
  private
58
55
 
59
- attr_reader :id
60
-
61
56
  def client
62
- Client.new
57
+ self.class.client
63
58
  end
64
59
 
65
- def configuration
66
- Configuration
60
+ def id
61
+ attributes.id
67
62
  end
68
63
 
69
64
  def routes
70
- configuration.routes
65
+ self.class.routes
71
66
  end
72
67
  end
73
68
  end
@@ -1,7 +1,7 @@
1
1
  module Wes
2
2
  module Data
3
3
  module API
4
- VERSION = "2.3.0".freeze
4
+ VERSION = "3.0.0".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wes-data-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler