Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benbalter committed Jul 8, 2014
1 parent a68937d commit a990b4e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a990b4e

Please sign in to comment.