numverify 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -6
  3. data/lib/numverify/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95a8e6ad4810a2cc64032f65558d0f47fe98c3f8
4
- data.tar.gz: a093132bcc6db581d0ab39d90359e1b4c57afc80
3
+ metadata.gz: c2f93ebdd35fa507e71d888e0bd6d302fef0ba83
4
+ data.tar.gz: 3cc485275e31dc7c6fe010d28ddef07f26959df6
5
5
  SHA512:
6
- metadata.gz: 96e19ffdb17c71d866b6203ca3f7e02fea5ec81c3e9ec734a15a48eca66648d88e0efcdb61cb9849c0f954d4ade67697eaa406fbf00ecadc380d61ac965c1416
7
- data.tar.gz: 7c2dc61c55487c1373f008a586fb5f8165bf77366d3fd403afcdcb6e9428b660220af76c288378c941f8faacc73e06996d88bd9b27e1a9994496a2b201cd3696
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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/numverify`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/numverify.
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chronogolf/numverify.
36
73
 
37
74
 
38
75
  ## License
@@ -1,3 +1,3 @@
1
1
  module NumverifyClient
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numverify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Buffon