folio_client 0.3.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 960e3e0d138665bbf21b4f609fb7c789c52110101bf303c42ba2c98b93583b98
4
- data.tar.gz: b2690e1193c7391a6e4bd6bae4c4f417f395ed91faa50d6215c43e1fc39aaadd
3
+ metadata.gz: 4e53de53a53383306d8d102202f46a3d7812fea93d63ba876e4be9f3d31c122a
4
+ data.tar.gz: 6a923cb74ab603ecba4fc9e909da87fdcd0a2540cbc58dafc381147012ae1a4f
5
5
  SHA512:
6
- metadata.gz: 42cbfadefe92754026e08435bd06378e6dee17ae97e539bd9d71d7833e873c02194ad1762690b55087f002f5fca553f63579a981dfe915674ee95fb8e839bbf2
7
- data.tar.gz: 4e2067aa01d4cd2534079cc9a5d11834d73432cd05c209fc57553713ec7d07a27dcf458ec52cace086fab3971d0fe3b9048e3e30e0669d3736d2ea37dcd0589b
6
+ metadata.gz: 1bf690f79b82a5ec7c7a53b88867671a389bcae846832971ecb8a07f55f227b3c77761270e1d584207a6c4b1775e00f49d5ddadaea1d10bb6c9ce4a64bbb69b4
7
+ data.tar.gz: 98520694ded40e076ee49a456f46ad1b2c460c34d247fff9d519f9e5f5f4ae825e1ea2f3a56f7d8118301b14b8ffb02aa12c44cbe7e6106e9b1451f6fe8344fd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- folio_client (0.3.0)
4
+ folio_client (0.3.1)
5
5
  activesupport (>= 4.2, < 8)
6
6
  faraday
7
7
  zeitwerk
@@ -98,6 +98,7 @@ GEM
98
98
  PLATFORMS
99
99
  x86_64-darwin-19
100
100
  x86_64-darwin-20
101
+ x86_64-darwin-21
101
102
  x86_64-linux
102
103
 
103
104
  DEPENDENCIES
@@ -11,6 +11,7 @@ class FolioClient
11
11
  end
12
12
 
13
13
  # @param barcode [String] barcode to search by to fetch the HRID
14
+ # @return [String,nil] HRID if present, otherwise nil.
14
15
  def fetch_hrid(barcode:)
15
16
  # find the instance UUID for this barcode
16
17
  instance = client.get("/search/instances", {query: "items.barcode==#{barcode}"})
@@ -3,20 +3,23 @@
3
3
  class FolioClient
4
4
  # Handles unexpected responses when communicating with Folio
5
5
  class UnexpectedResponse
6
+ # Base class for all FolioClient errors
7
+ class FolioClientError < StandardError; end
8
+
6
9
  # Error raised by the Folio Auth API returns a 422 Unauthorized
7
- class UnauthorizedError < StandardError; end
10
+ class UnauthorizedError < FolioClientError; end
8
11
 
9
12
  # Error raised when the Folio API returns a 404 NotFound, or returns 0 results when one was expected
10
- class ResourceNotFound < StandardError; end
13
+ class ResourceNotFound < FolioClientError; end
11
14
 
12
15
  # Error raised when e.g. exactly one result was expected, but more than one was returned
13
- class MultipleResourcesFound < StandardError; end
16
+ class MultipleResourcesFound < FolioClientError; end
14
17
 
15
18
  # Error raised when the Folio API returns a 403 Forbidden
16
- class ForbiddenError < StandardError; end
19
+ class ForbiddenError < FolioClientError; end
17
20
 
18
21
  # Error raised when the Folio API returns a 500
19
- class ServiceUnavailable < StandardError; end
22
+ class ServiceUnavailable < FolioClientError; end
20
23
 
21
24
  # @param [Faraday::Response] response
22
25
  def self.call(response)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class FolioClient
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: folio_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport