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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2336910f5676295cd330c67f3a54741646307253
4
- data.tar.gz: 15b5517754601df7e84a94bbe4658f6b98d75fee
3
+ metadata.gz: a2bd7ecf67babd9ba2bdcdfab2b7ebaad663d9e1
4
+ data.tar.gz: 7cf9e9ffee577cb510d1f8fe6796661093444a11
5
5
  SHA512:
6
- metadata.gz: 13d8eb24d6adb08685d8144e37dffa8739df588142eb3e2c4f09d3f4df333d72cb669130bd1005b4b20f56fd30a6c8e5db4ffcf2fbdd90e70112f2aba2dd5232
7
- data.tar.gz: 3b76588dd8d177e047ce258b02da73f0526361b6afe3e82ca1b7ab42a566eca04eb497f9a124cb4e7806b967f249bfc660faa95bc524bb0e6a8f2d26b1ba4088
6
+ metadata.gz: 3ec45b528954f179a42d4cc15f1799cb1c8c0f85aff9be6486a866c0a848cc9026a275743689db1ec64c2612355065308e0085da6dabb1fce847c077019880e1
7
+ data.tar.gz: d649f923eb3a887a6b3210dd1d26b4100d7b0ecb070567c7210435ac198edd831d362e661be98d7ce921b4f129aa32bc037efb2c0e1e05e51f792721ff4cb80a
@@ -41,8 +41,9 @@ loop do
41
41
  end
42
42
 
43
43
  print "\nSelect Artist (1..) : "
44
- a_select=gets.to_i
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(a_select, page)
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
@@ -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
@@ -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/?q[taxon_ids)=artist_id&page=#{page_no}")
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
@@ -1,3 +1,3 @@
1
1
  module ApApiTools
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ApApiTools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Smith