numverify 0.1.0 → 0.1.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 +4 -4
- data/README.md +43 -6
- data/lib/numverify/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: c2f93ebdd35fa507e71d888e0bd6d302fef0ba83
|
4
|
+
data.tar.gz: 3cc485275e31dc7c6fe010d28ddef07f26959df6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12f981692413f0a74793f3425dc9abae382943824c6c689a8147e9babc0b8d528295014d1c1f8d46b3b2cf93797fbc21fc825d28218ceac28a59b3e65e37903f
|
7
|
+
data.tar.gz: 5a98e433a6e5a271a0ee6243bd9ea41363fd0f9013e330a5d764715a28f8b23d96bc874e09832faf7c7f873a33db7456613ed5fddb7f40c1c507c9ef987c04ce
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# Numverify
|
1
|
+
# Numverify API Client
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This gem is a non-official Ruby Client for Numverify API service.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,46 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
#### Requirments
|
24
|
+
|
25
|
+
In order to use the client with your Numverify account I'll need to specify you `ACCESS_KEY`
|
26
|
+
This can be done on the fly like:
|
27
|
+
```ruby
|
28
|
+
NumverifyClient.validate(... access_key: 'YOUR_ACCESS_KEY')
|
29
|
+
```
|
30
|
+
Or more permanently by using the environment variable
|
31
|
+
```ruby
|
32
|
+
ENV['NUMVERIFY_ACCESS_KEY']
|
33
|
+
```
|
34
|
+
|
35
|
+
#### Number Validation:
|
36
|
+
|
37
|
+
To validate a phone number just use the `validate` method like:
|
38
|
+
```ruby
|
39
|
+
NumverifyClient.validate(number: '4158586273')
|
40
|
+
```
|
41
|
+
Optionally, you can also specify the country code:
|
42
|
+
```ruby
|
43
|
+
NumverifyClient.validate(number: '4158586273', country_code: 'US')
|
44
|
+
```
|
45
|
+
This will return the API response as a `NumverifyClient::Result` object.
|
46
|
+
|
47
|
+
## Error handling
|
48
|
+
|
49
|
+
Here is the list of every error managed by the gem:
|
50
|
+
|
51
|
+
|API error code|Error class name |
|
52
|
+
|:-------------|---------------------------|
|
53
|
+
|404 |NotFoundError |
|
54
|
+
|101 |InvalidAccessKeyError |
|
55
|
+
|103 |InvalidApiFunctionError |
|
56
|
+
|210 |NoPhoneNumberError |
|
57
|
+
|211 |NonNumericPhoneNumberError |
|
58
|
+
|310 |InvalidCountryCodeError |
|
59
|
+
|104 |UsageLimitError |
|
60
|
+
|105 |HttpsAccessRestrictionError|
|
61
|
+
|102 |InactiveUserError |
|
62
|
+
|Other |APIError |
|
26
63
|
|
27
64
|
## Development
|
28
65
|
|
@@ -32,7 +69,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
69
|
|
33
70
|
## Contributing
|
34
71
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
72
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chronogolf/numverify.
|
36
73
|
|
37
74
|
|
38
75
|
## License
|
data/lib/numverify/version.rb
CHANGED