vhx-ruby 0.0.6 → 0.0.7
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/video.rb +4 -0
- data/lib/vhx/utilities/vhx_object.rb +8 -4
- data/lib/vhx/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3fc113efc37f664b7f62505bdf410c86ae76cc4
|
4
|
+
data.tar.gz: 1b04aaa9fe91585a6c3be1e6feb3b6340d2a6ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae25bb65da0752a96c67c5ad311f49e7caa10c0fec85c0bd36d34699c4ce4ab0c05d55f2d86b2eb32c94986aa653196cedee138b0fbdbc151f53d2d6f3631692
|
7
|
+
data.tar.gz: b1282761cb591341d18d68c6de39d03ac4b4e3c09a80c1c281c4601bd0763ef9e24ab12b5eecc357c9db0cebe43eb2cc8ee857aaf19edbddf1346a0775cf5297
|
data/lib/vhx/objects/video.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Vhx
|
2
2
|
class VhxObject
|
3
3
|
include HelperMethods
|
4
|
-
ASSOCIATION_WHITELIST = ['products', 'sites', 'site', 'videos', 'video', 'subscription', '
|
4
|
+
ASSOCIATION_WHITELIST = ['products', 'sites', 'site', 'videos', 'video', 'subscription', 'items', 'customer']
|
5
5
|
|
6
6
|
def initialize(obj_hash)
|
7
7
|
@obj_hash = obj_hash
|
@@ -32,10 +32,15 @@ module Vhx
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def _links
|
35
|
-
JSON.parse(@obj_hash['_links'].to_json
|
35
|
+
JSON.parse(@obj_hash['_links'].to_json)
|
36
|
+
end
|
37
|
+
|
38
|
+
def _embedded
|
39
|
+
JSON.parse(@obj_hash['_embedded'].to_json)
|
36
40
|
end
|
37
41
|
|
38
42
|
protected
|
43
|
+
|
39
44
|
def validate_class(obj_hash)
|
40
45
|
return nil unless obj_hash['_links'].fetch('self', nil)
|
41
46
|
|
@@ -90,8 +95,7 @@ module Vhx
|
|
90
95
|
|
91
96
|
def fetch_linked_association(obj_hash, association_method, payload = {})
|
92
97
|
response = Vhx.connection.get do |req|
|
93
|
-
req.url(obj_hash['_links'][association_method]['href'].gsub(Vhx.client.api_base_url, ""))
|
94
|
-
req.body = payload
|
98
|
+
req.url(obj_hash['_links'][association_method]['href'].gsub(Vhx.client.api_base_url, "") + '?' + URI.encode_www_form(payload))
|
95
99
|
end
|
96
100
|
|
97
101
|
build_association(response.body, association_method)
|
data/lib/vhx/version.rb
CHANGED