ApApiTools 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ap_api_tools.rb +4 -3
- data/lib/ap_api_tools/artist.rb +1 -1
- data/lib/ap_api_tools/product.rb +1 -1
- data/lib/ap_api_tools/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: a2bd7ecf67babd9ba2bdcdfab2b7ebaad663d9e1
|
4
|
+
data.tar.gz: 7cf9e9ffee577cb510d1f8fe6796661093444a11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec45b528954f179a42d4cc15f1799cb1c8c0f85aff9be6486a866c0a848cc9026a275743689db1ec64c2612355065308e0085da6dabb1fce847c077019880e1
|
7
|
+
data.tar.gz: d649f923eb3a887a6b3210dd1d26b4100d7b0ecb070567c7210435ac198edd831d362e661be98d7ce921b4f129aa32bc037efb2c0e1e05e51f792721ff4cb80a
|
data/lib/ap_api_tools.rb
CHANGED
@@ -41,8 +41,9 @@ loop do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
print "\nSelect Artist (1..) : "
|
44
|
-
|
45
|
-
|
44
|
+
seq_select=gets.to_i
|
45
|
+
artist_selected=artists.list.find { |a| a[:seq] == seq_select }
|
46
|
+
|
46
47
|
puts
|
47
48
|
puts "This Artist has this list of artworks"
|
48
49
|
puts "-"*38
|
@@ -50,7 +51,7 @@ loop do
|
|
50
51
|
page=1
|
51
52
|
|
52
53
|
loop do
|
53
|
-
artworks=Product.get_products(
|
54
|
+
artworks=Product.get_products(artist_selected[:id], page)
|
54
55
|
printf("%-3s %-3s %-20s %3s %-20s \n\n", 'Seq', 'ID', 'Name', "I-ID", "Name")
|
55
56
|
|
56
57
|
i=1
|
data/lib/ap_api_tools/artist.rb
CHANGED
@@ -16,7 +16,7 @@ class Artist
|
|
16
16
|
def list
|
17
17
|
i=0
|
18
18
|
# .first as there should only ever be one due to query above
|
19
|
-
@artists[:taxonomies].first[:root][:taxons].map{ |a| { seq: i+=1, id: a[:id], name: a[:name ] } }
|
19
|
+
@artists[:taxonomies].first[:root][:taxons].map{ |a| { seq: i+=1, id: a[:id], name: a[:name ] } }
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
data/lib/ap_api_tools/product.rb
CHANGED
@@ -29,7 +29,7 @@ private
|
|
29
29
|
:accept => "application/json",
|
30
30
|
'X-Spree-Token': "#{ApApiTools::API_KEY}"
|
31
31
|
)
|
32
|
-
.get("#{ApApiTools::HOST}/products
|
32
|
+
.get("#{ApApiTools::HOST}/taxons/products?id=#{artist_id}&page=#{page_no}")
|
33
33
|
|
34
34
|
JSON.parse(product_return.body, symbolize_names: true)
|
35
35
|
end
|
data/lib/ap_api_tools/version.rb
CHANGED