vhx-ruby 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vhx/objects/customer.rb +18 -0
- data/lib/vhx/utilities/api_operations/list.rb +4 -0
- data/lib/vhx/utilities/api_operations/request.rb +4 -0
- data/lib/vhx/utilities/vhx_object.rb +4 -0
- data/lib/vhx/version.rb +1 -1
- data/vhx.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69544b57dcaec324d5c1f1d4b440dd795b80e0bf
|
4
|
+
data.tar.gz: 51153d815eb91fca445ebae3fa2a86884a9af94f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f16a0bd34c133757cbe354dc900eefa9c364c62af7e3880efe8ca13ed7c5253bb24e8d4b902562e9140ee6fa09010af7927587f968747de64633bbc6209e39f
|
7
|
+
data.tar.gz: e32b6a79c4f8d2aa979b60a84637dcbbf97c27a76befb7ca5ac8f172bde2007462fe304aaf13123725fc5d67b55f70dd340e8089fe214d841e3157744031cfd9
|
data/lib/vhx/objects/customer.rb
CHANGED
@@ -4,5 +4,23 @@ module Vhx
|
|
4
4
|
include Vhx::ApiOperations::Request
|
5
5
|
include Vhx::ApiOperations::List
|
6
6
|
include Vhx::ApiOperations::Delete
|
7
|
+
|
8
|
+
def add_product(identifier)
|
9
|
+
response = Vhx.connection.put do |req|
|
10
|
+
req.url('/customers/' + self.id.to_s + '/products')
|
11
|
+
req.body = { product: get_hypermedia(identifier, 'Product') }
|
12
|
+
end
|
13
|
+
|
14
|
+
self.class.new(response.body)
|
15
|
+
end
|
16
|
+
|
17
|
+
def remove_product(identifier)
|
18
|
+
response = Vhx.connection.delete do |req|
|
19
|
+
req.url('/customers/' + self.id.to_s + '/products')
|
20
|
+
req.body = { product: get_hypermedia(identifier, 'Product') }
|
21
|
+
end
|
22
|
+
|
23
|
+
self.class.new(response.body)
|
24
|
+
end
|
7
25
|
end
|
8
26
|
end
|
data/lib/vhx/version.rb
CHANGED
data/vhx.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'vhx-ruby'
|
7
7
|
spec.version = Vhx::VERSION
|
8
8
|
spec.authors = ['Sagar Shah']
|
9
|
-
spec.date = '2016-
|
9
|
+
spec.date = '2016-02-16'
|
10
10
|
spec.description = 'A Ruby wrapper for the Vhx developer API.'
|
11
11
|
spec.summary = 'A Ruby wrapper for the Vhx developer API.'
|
12
12
|
spec.email = ['sagar@vhx.tv', 'dev@vhx.tv', 'wontae@vhx.tv', 'charlie@vhx.tv', 'kevin@vhx.tv', 'scott@vhx.tv']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vhx-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sagar Shah
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|