lucid_shopify-resource 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/lucid_shopify/resource/read.rb +3 -2
- data/lib/lucid_shopify/resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd5ffa2aca3d471e25c1a8f79417bd32005104577d956a6f8f3bd54a7607341a
|
4
|
+
data.tar.gz: 9d66e1acacdb14b5ef821926ba45c02846bc179beea2afd7275051430ce40d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be4177529bb1caaed4ee7203a94651e3e78759ab7c54586634fc758158e8bfd5a8dc7ae7302cc08c1aff60e899bafa963cbcc87d48474367818548a30f3455b2
|
7
|
+
data.tar.gz: 85e10df75cb94eeeb22bec298456c78b7a783a9a3898e585b0cd629f3261f742c10c7f6deeb975e60737c07a870b8d213d7dbfdacefebf9d37230335cf11d514
|
data/README.md
CHANGED
@@ -25,9 +25,11 @@ _TODO: Implement when needed._
|
|
25
25
|
|
26
26
|
### Read a resource
|
27
27
|
|
28
|
-
|
28
|
+
Include and configure `Read`:
|
29
|
+
|
30
|
+
class OrderRepository
|
31
|
+
include LucidShopify::Resource::Read
|
29
32
|
|
30
|
-
class Orders < LucidShopify::Resource::Read
|
31
33
|
resource :orders
|
32
34
|
|
33
35
|
default_options fields: %w(id tags), limit: 250
|
@@ -37,12 +39,12 @@ Subclass and configure `Read`:
|
|
37
39
|
|
38
40
|
orders.find(request_credentials, id)
|
39
41
|
|
40
|
-
The `
|
41
|
-
rather than all at once:
|
42
|
+
The `OrderRepository` class is enumerable. Each page is fetched
|
43
|
+
from the API as needed, rather than all at once:
|
42
44
|
|
43
|
-
|
45
|
+
order_repo = OrderRepository.new
|
44
46
|
|
45
|
-
|
47
|
+
order_repo.each(request_credentials) |order|
|
46
48
|
# ...
|
47
49
|
end
|
48
50
|
|
@@ -120,14 +120,15 @@ module LucidShopify
|
|
120
120
|
end
|
121
121
|
|
122
122
|
#
|
123
|
+
# @param credentials [RequestCredentials]
|
123
124
|
# @param params [Hash]
|
124
125
|
#
|
125
126
|
# @return [Integer]
|
126
127
|
#
|
127
|
-
def count(params = {})
|
128
|
+
def count(credentials, params = {})
|
128
129
|
params = finalize_params(params)
|
129
130
|
|
130
|
-
client.get("#{resource}/count", params)['count']
|
131
|
+
client.get(credentials, "#{resource}/count", params)['count']
|
131
132
|
end
|
132
133
|
|
133
134
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucid_shopify-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelsey Judson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|