blomming_api 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blomming_api/private_helpers.rb +17 -1
- data/lib/blomming_api/public_helpers.rb +17 -4
- data/lib/blomming_api/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: 40ff555448ed2878816e332e6317be02736c8687
|
4
|
+
data.tar.gz: 65c583d94cc89a3bc7e132dbad16ad3b119b2bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b290a3bc6cd3febbcbad37da51a414c44460fb226b18cb242d977a482735b4a48663aec300beb1637944b21a727aa827672c284d5e051069b9dc3e98b1a336b8
|
7
|
+
data.tar.gz: e1b55e7819b70ff46867d89638825e58263bdf5822c54cbbc181e27f60c9ed1c58f3ea6c31b091d53b9cc80aa3ff2afa1031a90774b663ceec5b1c2bf120f49c
|
@@ -19,7 +19,23 @@ module BlommingApi
|
|
19
19
|
end
|
20
20
|
|
21
21
|
#
|
22
|
-
#
|
22
|
+
# load_or_retry: manage RestClient exceptions. iterator.
|
23
|
+
#
|
24
|
+
# === attributes
|
25
|
+
#
|
26
|
+
# retry_seconds
|
27
|
+
# number of seconds between a call and the successivem in case of a retry
|
28
|
+
#
|
29
|
+
# &restclient_call_block
|
30
|
+
# the block to be passed (containing call to RestCient method)
|
31
|
+
#
|
32
|
+
# === examples
|
33
|
+
#
|
34
|
+
# load_or_retry { RestClient.get url, req }
|
35
|
+
#
|
36
|
+
# load_or_retry(5) do
|
37
|
+
# RestClient.get url, req
|
38
|
+
# end
|
23
39
|
#
|
24
40
|
def load_or_retry (retry_seconds=2, &restclient_call_block)
|
25
41
|
begin
|
@@ -8,12 +8,25 @@ module BlommingApi
|
|
8
8
|
#
|
9
9
|
# all_pages
|
10
10
|
# It's a Ruby block iterator that retrieve all items of all pages of any API endpoint.
|
11
|
-
#
|
12
|
-
#
|
11
|
+
#
|
12
|
+
# === attributes
|
13
|
+
#
|
14
|
+
# +verbose+: :quite (silent mode)
|
15
|
+
# :stdout (verbose mode: stdout puts)
|
16
|
+
#
|
17
|
+
# +per_page+: :number of items returned from a single page
|
18
|
+
#
|
19
|
+
#
|
20
|
+
# === examples
|
21
|
+
#
|
22
|
+
# all_pages(:stdout, 64) do |page, per_page|
|
13
23
|
# client.shop_items(shop_id, {:page => page, :per_page => per_page})
|
14
|
-
#
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# all_pages { |page, per_page| c.sell_shop_items page: page, per_page: per_page }
|
27
|
+
#
|
15
28
|
#
|
16
|
-
def all_pages (verbose=:
|
29
|
+
def all_pages (verbose=:quite, per_page=16, &endpoint_call_block)
|
17
30
|
page = 1
|
18
31
|
data = []
|
19
32
|
|
data/lib/blomming_api/version.rb
CHANGED