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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc09c71f93eb8134c49da861fb7bd8fdc234dd18c7c9e5cd936951304bd5f552
|
4
|
+
data.tar.gz: fbdd965f960af57b8d02158bcd8a4d8ab4a46542c510d5db5114621b8924139a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a36195d49bcb116f9b8b8090e2d73b6d901ea5249634799b372d2560e1ab590127afb15651db6bc6b36aa90eebb4868976bca555641b520b4e0d7538e7b0577b
|
7
|
+
data.tar.gz: '081668658edb5e0342959378245a2a1881801dbcb47b2a18cfb7493a4c2c3a2586c5b706d2c37f5b29c0877e91bd15956c3c0ce243b8c817bfc8732a72a68f7c'
|
data/Gemfile.lock
CHANGED
data/lib/woo_commerce/client.rb
CHANGED
@@ -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
|
data/lib/woo_commerce/version.rb
CHANGED
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.
|
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-
|
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
|