-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,29 +22,33 @@ Or add this to your `Gemfile` before doing a `bundle install`: | |
|
||
## Usage | ||
|
||
### In general | ||
|
||
### Verify email addresses | ||
|
||
```ruby | ||
Gman.valid? "[email protected]" #true | ||
Gman.valid? "[email protected]" #false | ||
Gman.valid? "[email protected]" #=> true | ||
Gman.valid? "[email protected]" #=> false | ||
``` | ||
|
||
### Verify domain | ||
|
||
```ruby | ||
Gman.valid? "http://foo.bar.gov" #true | ||
Gman.valid? "foo.bar.gov" #true | ||
Gman.valid? "foo.gov" #true | ||
Gman.valid? "foo.biz" #false | ||
Gman.valid? "http://foo.bar.gov" #=> true | ||
Gman.valid? "foo.bar.gov" #=> true | ||
Gman.valid? "foo.gov" #=> true | ||
Gman.valid? "foo.biz" #=> false | ||
``` | ||
|
||
### Get a domain name from an arbitrary domain string | ||
### Get the ISO Country Code information represented by a government domain | ||
|
||
```ruby | ||
Gman.get_domain "http://foo.bar.gov" # foo.bar.gov | ||
Gman.get_domain "[email protected]" # bar.gov | ||
Gman.get_domain "foo.bar.gov" # foo.bar.gov | ||
Gman.get_domain "asdf@asdf" # nil (no domain within the string) | ||
domain = Gman.new "whitehouse.gov" #=> #<Gman domain="whitehouse.gov" valid=true> | ||
domain.country.name #=> "United States" | ||
domain.country.alpha2 #=> "US" | ||
domain.country.alpha3 #=> "USA" | ||
domain.country.currency #=> "USD" | ||
domain.conutry.calling_code #=> "+1" | ||
``` | ||
|
||
## Contributing | ||
|