gds-api-adapters 47.3.0 → 47.4.0
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/lib/gds_api/publishing_api_v2.rb +21 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e689f6448b3411396ee69a44468c4d223001c8c
|
|
4
|
+
data.tar.gz: 0b941e5bed41abca46bc8773297ba6d89a7f5f33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec0d6a997c06c3f4188bba22374ee4239903345dac3d6d10c9fabc4df744a63c538afb24b4c061eb8414693c7bb1e0f113717d4803ecdc6adf704689778110fc
|
|
7
|
+
data.tar.gz: a8402fc59d3c2a61e4d36853de91ca944e628c94991e425a00f4d29b53569452d3cbdd131a08eeba22bd6c3a0dddbd46c3d7dfa11671c26aff781b83a27a64a6
|
|
@@ -324,6 +324,27 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
|
|
|
324
324
|
get_json(get_editions_url(params))
|
|
325
325
|
end
|
|
326
326
|
|
|
327
|
+
# Returns an Enumerator of Response objects for each page of results of
|
|
328
|
+
# editions for the provided query string parameters.
|
|
329
|
+
#
|
|
330
|
+
# @param params [Hash]
|
|
331
|
+
#
|
|
332
|
+
# @return [Enumerator] an enumerator of editions responses
|
|
333
|
+
#
|
|
334
|
+
# @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#get-v2editions
|
|
335
|
+
def get_paged_editions(params = {})
|
|
336
|
+
Enumerator.new do |yielder|
|
|
337
|
+
next_link = get_editions_url(params)
|
|
338
|
+
while next_link
|
|
339
|
+
yielder.yield begin
|
|
340
|
+
response = get_json(next_link)
|
|
341
|
+
end
|
|
342
|
+
next_link_info = response['links'].select { |link| link['rel'] == 'next' }.first
|
|
343
|
+
next_link = next_link_info && next_link_info['href']
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
|
|
327
348
|
private
|
|
328
349
|
|
|
329
350
|
def content_url(content_id, params = {})
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gds-api-adapters
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 47.
|
|
4
|
+
version: 47.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Stewart
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-07-
|
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: plek
|