IpFormatValidator
This gem checks the format of an IP address. The two requirements for the format of the IP address:
- Must either be IPv4 or IPv6 format
- Must be a public IP address.
Installation
Add this line to your application's Gemfile:
gem 'ip_format_validator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ip_format_validator
Usage
# Using ActiveRecord
class foo < ActiveRecord::Base
validates :bar, ip_format: true
end
Contributing
- Fork it ( https://github.com/[my-github-username]/ip_format_validator/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request