zanoxrb 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zanox/resources/product.rb +5 -0
- data/lib/zanox/version.rb +1 -1
- data/specs/resources/product_spec.rb +12 -0
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95f3c106206a90f99fb34905b00304e6b7495479
|
4
|
+
data.tar.gz: f3b59e1204b2e10f74a074a5f8bbb38edfb64d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39a2665ad1298a4aee9d7794ea52893a37859cdb402b82478b708e1e29dd01fac9b61765abacc6d76c728824b2621b3c579d25a92950f780006a4e52d775b594
|
7
|
+
data.tar.gz: 36da2a427e9053348d0f2cb89174cf321aca374b9237154c6224f59f7b68321e580f7cf961a74f512af47a8055fcd5d8420998884114c7c96d1d406c70fc4b7c
|
@@ -76,6 +76,11 @@ module Zanox
|
|
76
76
|
response = API.request(:products, args)
|
77
77
|
response.product_items.map { |product| new(product) }
|
78
78
|
end
|
79
|
+
|
80
|
+
def from_id(product_id, args = {})
|
81
|
+
response = API.request("products/product/#{product_id}", args)
|
82
|
+
new(response.product_item.first)
|
83
|
+
end
|
79
84
|
end
|
80
85
|
|
81
86
|
private
|
data/lib/zanox/version.rb
CHANGED
@@ -37,6 +37,18 @@ describe Zanox::Product do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe '#from_id' do
|
41
|
+
let(:product) { Zanox::Product.from_id('0eca835e6c78e10c3b31a8146fc12324') }
|
42
|
+
|
43
|
+
it 'returns a Product' do
|
44
|
+
expect(product).to be_a(Zanox::Product)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'returns a Product matching given id' do
|
48
|
+
expect(product.pid).to eq('0eca835e6c78e10c3b31a8146fc12324')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
40
52
|
describe '#initialize' do
|
41
53
|
let(:data) do
|
42
54
|
{
|
metadata
CHANGED
@@ -1,21 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zanoxrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
version_requirements: !ruby/object:Gem::Requirement
|
15
|
-
requirements:
|
16
|
-
- - "~>"
|
17
|
-
- !ruby/object:Gem::Version
|
18
|
-
version: '0.13'
|
19
14
|
name: httparty
|
20
15
|
prerelease: false
|
21
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,12 +19,12 @@ dependencies:
|
|
24
19
|
- !ruby/object:Gem::Version
|
25
20
|
version: '0.13'
|
26
21
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
22
|
version_requirements: !ruby/object:Gem::Requirement
|
29
23
|
requirements:
|
30
24
|
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '0.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
33
28
|
name: ruby-try
|
34
29
|
prerelease: false
|
35
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,12 +33,12 @@ dependencies:
|
|
38
33
|
- !ruby/object:Gem::Version
|
39
34
|
version: '1.1'
|
40
35
|
type: :runtime
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
prerelease: false
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,12 +47,12 @@ dependencies:
|
|
52
47
|
- !ruby/object:Gem::Version
|
53
48
|
version: '10.4'
|
54
49
|
type: :development
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
54
|
+
version: '10.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
61
56
|
name: rspec
|
62
57
|
prerelease: false
|
63
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,12 +61,12 @@ dependencies:
|
|
66
61
|
- !ruby/object:Gem::Version
|
67
62
|
version: '3.3'
|
68
63
|
type: :development
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
66
|
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
68
|
+
version: '3.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
75
70
|
name: rspec-collection_matchers
|
76
71
|
prerelease: false
|
77
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,15 +75,12 @@ dependencies:
|
|
80
75
|
- !ruby/object:Gem::Version
|
81
76
|
version: '1.1'
|
82
77
|
type: :development
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
80
|
- - "~>"
|
87
81
|
- !ruby/object:Gem::Version
|
88
|
-
version: '1.
|
89
|
-
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: 1.10.5
|
82
|
+
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
92
84
|
name: bundler
|
93
85
|
prerelease: false
|
94
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,6 +92,14 @@ dependencies:
|
|
100
92
|
- !ruby/object:Gem::Version
|
101
93
|
version: 1.10.5
|
102
94
|
type: :development
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '1.10'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.10.5
|
103
103
|
description: A Ruby wrapper for Zanox's RESTful APIs because all the current alternatives
|
104
104
|
outta here are shit.
|
105
105
|
email: webmaster@giovannicapuano.net
|