alma 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8abf09ab18832b9e07c6ff3f19f55579799558aeeb94434757f4295d3e15be1
4
- data.tar.gz: aa9956de6794d3a2d7e1690aab759e80cb62dd1c6a4c6525132ff57b5f82d5d9
3
+ metadata.gz: ffe7f9e2bafe164f38d89d6ca0c4b97d13eb778e9e59dbe7995aa6622fe0dfb5
4
+ data.tar.gz: e887790912286f3750b83f34435a2e9870a57ca56f9cb85de971c64682967964
5
5
  SHA512:
6
- metadata.gz: 27a32ba65c33fb1d78dfc9a0cf13b504661667ed4eacf3d80136cb0ad2eeedb1ef20bed4cc5a2109c75984b6f276443aee9de21561e845f5950f6ea0690a337a
7
- data.tar.gz: 28b451a986c72c7e9564f0f1933f5ba356863c14871176a0da50a83ad4de9a38da7ec9c9466aeb172408f0331228dc756a66fec6fc7a509e03e5cc9b696d30b4
6
+ metadata.gz: 2e7d1d3246dda68dc81d5ab05356d73969421053b20a830181d937239d3e6446cba8f7e6f9ff805673693b287a0b6549a1f6c54ac0b11b172bcaa85449f844d6
7
+ data.tar.gz: cf3ba3362fd3809039df685cffe2b4b9d3b8a9f02bbd0968fca761c8d72bf3bb41e0be542574d6acef3bfc81e246b097596db26a974acb1f8fda444cb85a8257
data/lib/alma/loan_set.rb CHANGED
@@ -39,8 +39,9 @@ module Alma
39
39
  def all
40
40
  Enumerator.new do |yielder|
41
41
  offset = 0
42
+ limit = 100
42
43
  loop do
43
- extra_args = @search_args.merge({ limit: 100, offset: })
44
+ extra_args = @search_args.merge({ limit:, offset: })
44
45
  r = (offset == 0) ? self : single_record_class.where_user(user_id, extra_args)
45
46
 
46
47
  unless r.empty?
@@ -48,7 +49,11 @@ module Alma
48
49
  offset += 100
49
50
  end
50
51
 
51
- if r.empty? || r.count < extra_args[:limit]
52
+ # TODO: r.count greater than "limit" doesn't make any sense unless the ALMA User/Loan API is broken.
53
+ # We should remove this qualification in October once Alma fixes the bug they introduced in their
54
+ # September release.
55
+ # @see https://developers.exlibrisgroup.com/forums/topic/limit-and-offset-not-being-applied-to-retrieve-user-loans-api/
56
+ if r.empty? || r.count < limit || r.count > limit
52
57
  raise StopIteration
53
58
  end
54
59
  end
data/lib/alma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alma
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jennifer Anton