Skip to content

Commit

Permalink
Merge pull request #21 from olleolleolle/patch-2
Browse files Browse the repository at this point in the history
README: Markdown formatting, code fences
  • Loading branch information
frewsxcv committed Aug 17, 2017
2 parents 5f60747 + ce59a08 commit c1b507f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Expand Up @@ -9,25 +9,33 @@ A ruby port of the [ipcat](https://github.com/client9/ipcat) library to classify

With bundler:

# In Gemfile
gem 'ipcat'
```ruby
# In Gemfile
gem 'ipcat'
```

Or with rubygems:

gem install ipcat
```shell
gem install ipcat
```

## Usage

IPCat.datacenter?(ip_address)
```ruby
IPCat.datacenter?(ip_address)
```

It will return an IPCat::IPRange if ip_address is from a known datacenter; nil otherwise.
It will return an `IPCat::IPRange` if `ip_address` is from a known datacenter; `nil` otherwise.

For example,

range = IPCat.datacenter?('52.95.252.0') # => instance of IPCat::IPRange
range.name # => 'Amazon AWS'
```ruby
range = IPCat.datacenter?('52.95.252.0') # => instance of IPCat::IPRange
range.name # => 'Amazon AWS'

IPCat.datacenter?('127.0.0.1') # => nil
IPCat.datacenter?('127.0.0.1') # => nil
```

## License

Expand Down

0 comments on commit c1b507f

Please sign in to comment.