woocommercerb 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 2f7654089a34f24c6933243630226e58da26617e8022f5354622c51616df4d3c
4
- data.tar.gz: 821bacc1a3ac46dd98c45eed3fc67e435023ac52f1f716566fe6d6e89bc0d82c
3
+ metadata.gz: bc09c71f93eb8134c49da861fb7bd8fdc234dd18c7c9e5cd936951304bd5f552
4
+ data.tar.gz: fbdd965f960af57b8d02158bcd8a4d8ab4a46542c510d5db5114621b8924139a
5
5
  SHA512:
6
- metadata.gz: b9c911b990804c87b1877149d7cde1f9117037ded67c3b9b0f2b93b6fd1819e82844cf23c78610f0eb92203fe4d5043ae922aa24e26907ee98a62690f48563df
7
- data.tar.gz: 4da457a6d06095edc6ed3a633cca039c9cfb953f99122f2a001580a7d75f92074083576eb050e90b3616c47753f1fe81c5efd58aa39e7213d278e2550991490e
6
+ metadata.gz: a36195d49bcb116f9b8b8090e2d73b6d901ea5249634799b372d2560e1ab590127afb15651db6bc6b36aa90eebb4868976bca555641b520b4e0d7538e7b0577b
7
+ data.tar.gz: '081668658edb5e0342959378245a2a1881801dbcb47b2a18cfb7493a4c2c3a2586c5b706d2c37f5b29c0877e91bd15956c3c0ce243b8c817bfc8732a72a68f7c'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- woocommercerb (0.1.0)
4
+ woocommercerb (0.1.1)
5
5
  faraday (~> 2.0)
6
6
 
7
7
  GEM
@@ -33,6 +33,10 @@ module WooCommerce
33
33
  ProductsResource.new(self)
34
34
  end
35
35
 
36
+ def product_variations
37
+ ProductVariationsResource.new(self)
38
+ end
39
+
36
40
  def product_categories
37
41
  ProductCategoriesResource.new(self)
38
42
  end
@@ -0,0 +1,4 @@
1
+ module WooCommerce
2
+ class ProductVariation < Object
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ module WooCommerce
2
+ class ProductVariationsResource < Resource
3
+
4
+ def list(product:, **params)
5
+ response = get_request("products/#{product}/variations", params: params)
6
+ Collection.from_response(response, type: ProductVariation)
7
+ end
8
+
9
+ def retrieve(product:, id:)
10
+ ProductVariation.new get_request("products/#{product}/variations/#{id}").body
11
+ end
12
+
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WooCommerce
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/woo_commerce.rb CHANGED
@@ -16,6 +16,7 @@ module WooCommerce
16
16
  autoload :OrderNotesResource, "woo_commerce/resources/order_notes"
17
17
  autoload :ProductsResource, "woo_commerce/resources/products"
18
18
  autoload :ProductCategoriesResource, "woo_commerce/resources/product_categories"
19
+ autoload :ProductVariationsResource, "woo_commerce/resources/product_variations"
19
20
 
20
21
  autoload :Coupon, "woo_commerce/objects/coupon"
21
22
  autoload :Customer, "woo_commerce/objects/customer"
@@ -23,5 +24,6 @@ module WooCommerce
23
24
  autoload :OrderNote, "woo_commerce/objects/order_note"
24
25
  autoload :Product, "woo_commerce/objects/product"
25
26
  autoload :ProductCategory, "woo_commerce/objects/product_category"
27
+ autoload :ProductVariation, "woo_commerce/objects/product_variation"
26
28
 
27
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woocommercerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-06 00:00:00.000000000 Z
11
+ date: 2022-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -47,12 +47,14 @@ files:
47
47
  - lib/woo_commerce/objects/order_note.rb
48
48
  - lib/woo_commerce/objects/product.rb
49
49
  - lib/woo_commerce/objects/product_category.rb
50
+ - lib/woo_commerce/objects/product_variation.rb
50
51
  - lib/woo_commerce/resource.rb
51
52
  - lib/woo_commerce/resources/coupons.rb
52
53
  - lib/woo_commerce/resources/customers.rb
53
54
  - lib/woo_commerce/resources/order_notes.rb
54
55
  - lib/woo_commerce/resources/orders.rb
55
56
  - lib/woo_commerce/resources/product_categories.rb
57
+ - lib/woo_commerce/resources/product_variations.rb
56
58
  - lib/woo_commerce/resources/products.rb
57
59
  - lib/woo_commerce/version.rb
58
60
  - lib/woocommercerb.rb