ncua 0.8.4 → 0.9.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/README.md +4 -0
- data/lib/ncua/credit_union/details_client.rb +4 -0
- data/lib/ncua/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: 398980c10ce254d16210333409e04c87bb466da2
|
4
|
+
data.tar.gz: a1bd3146b069403d2e26bcbc06d21b7b980727a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc57569862938332daca4e6e6357aa69e42aeb4e6291c0735c33b38ee6fb3ff0ccffb35624c15a888769a17100d6c0c607cac8293dbfc10f78c9b41557f1510
|
7
|
+
data.tar.gz: b824aece7492cccc508b30233a4003be96482d33bfbe41d6eebad135966c6d9cf71391e04f92ad1e1325771d896b6f7da5a9f92a63443e396861aea0523808b3
|
data/README.md
CHANGED
@@ -110,8 +110,12 @@ You can also scrape this directly from the NCUA module by calling `NCUA.find_cre
|
|
110
110
|
|
111
111
|
If you pass `nil` into this method, it will raise an `ArgumentError`. The NCUA will actually return a 200 without a charter number, but the data on the page is blank.
|
112
112
|
|
113
|
+
If you pass a non-numeric argument, such as `"foo"` into this method, it will also raise an `ArgumentError`.
|
114
|
+
|
113
115
|
If for some reason the NCUA returns a 500 error when directly scraping for credit union details, the gem will raise `NCUA::CreditUnion::ServerError`. This can happen if your charter number is invalid.
|
114
116
|
|
117
|
+
In fact, we only really expect response codes in the 200 range. If the NCUA returns another response, the gem will raise `NCUA::CreditUnion::ServerError` with the response code in the description.
|
118
|
+
|
115
119
|
## Contributing
|
116
120
|
|
117
121
|
Bug reports and pull requests are welcome on GitHub at https://github.com/ContinuityControl/ncua.
|
@@ -11,6 +11,10 @@ module NCUA
|
|
11
11
|
raise ArgumentError, "charter number cannot be nil or empty string"
|
12
12
|
end
|
13
13
|
|
14
|
+
if !(charter_number =~ /\A\d+\z/)
|
15
|
+
raise ArgumentError, "charter number must contain only digits"
|
16
|
+
end
|
17
|
+
|
14
18
|
response = execute_query(charter_number)
|
15
19
|
|
16
20
|
case response.code
|
data/lib/ncua/version.rb
CHANGED