wes-data-api 7.1.0 → 8.0.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 +4 -4
- data/lib/wes/data/api.rb +1 -1
- data/lib/wes/data/api/routes.rb +0 -1
- metadata +2 -4
- data/lib/wes/data/api/billing.rb +0 -39
- data/lib/wes/data/api/model/billing.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 660f47ee41899d5d40397085d45ee91aa0c15cd7
|
4
|
+
data.tar.gz: a161311b99cb52e90ded36d58e14d77fb75aa3cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c496a5575ae262b0161c3997d22b4e7c97482ff725a5e9415d2f1b1ad9e3a50709c8eef657fb3bdb314c321930f215155a77d1b220dfafbba323ef007ce0f464
|
7
|
+
data.tar.gz: 5775d781127630c51c110171471b88b71e985b790ac62f46c9b0d0811c0a2d0c2a99d0b79cf4179e2df9bc7c851af4c821dbc6dbfb7ddd0c25efd763ec6aa0cf
|
data/lib/wes/data/api.rb
CHANGED
data/lib/wes/data/api/routes.rb
CHANGED
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:
|
4
|
+
version: 8.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-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- Gemfile
|
119
119
|
- lib/wes/data/api.rb
|
120
120
|
- lib/wes/data/api/base.rb
|
121
|
-
- lib/wes/data/api/billing.rb
|
122
121
|
- lib/wes/data/api/brand.rb
|
123
122
|
- lib/wes/data/api/brand_user.rb
|
124
123
|
- lib/wes/data/api/challenge.rb
|
@@ -129,7 +128,6 @@ files:
|
|
129
128
|
- lib/wes/data/api/error/response.rb
|
130
129
|
- lib/wes/data/api/error/unexpected.rb
|
131
130
|
- lib/wes/data/api/model/base.rb
|
132
|
-
- lib/wes/data/api/model/billing.rb
|
133
131
|
- lib/wes/data/api/model/brand.rb
|
134
132
|
- lib/wes/data/api/model/brand_user.rb
|
135
133
|
- lib/wes/data/api/model/challenge.rb
|
data/lib/wes/data/api/billing.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require "wes/data/api/base"
|
2
|
-
require "wes/data/api/model/billing"
|
3
|
-
|
4
|
-
module Wes
|
5
|
-
module Data
|
6
|
-
module API
|
7
|
-
class Billing
|
8
|
-
class << self
|
9
|
-
include Base
|
10
|
-
|
11
|
-
def create(data)
|
12
|
-
attributes = client.post(routes.billing, data).first
|
13
|
-
attributes.nil? ? nil : model_klass.new(attributes)
|
14
|
-
end
|
15
|
-
|
16
|
-
def find(key, value)
|
17
|
-
attributes = client.get(find_route(key, value)).first
|
18
|
-
attributes.nil? ? nil : model_klass.new(attributes)
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def find_route(key, value)
|
24
|
-
case key
|
25
|
-
when :id
|
26
|
-
[routes.billing, value].join("/")
|
27
|
-
when :user_id
|
28
|
-
[routes.creator_user, value, routes.billing].join("/")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def model_klass
|
33
|
-
Wes::Data::API::Model::Billing
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require "wes/data/api/model/base"
|
2
|
-
|
3
|
-
module Wes
|
4
|
-
module Data
|
5
|
-
module API
|
6
|
-
module Model
|
7
|
-
class Billing < Base
|
8
|
-
def update(changes)
|
9
|
-
route = [routes.billing, id].join("/")
|
10
|
-
@attributes = client.put(
|
11
|
-
route, @attributes.to_h.merge(changes)
|
12
|
-
).first
|
13
|
-
|
14
|
-
self
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|