exvalidate v0.0.2 Exvalidate.Rules.IpV4 View Source
Validating ip version 4.
Examples
iex(3)> Exvalidate.Rules.IpV4.validating(:ipv4, "124.0")
{:error, :bad_ipv4}
iex(3)> Exvalidate.Rules.IpV4.validating(:ipv4, "124.0.0.1")
{:ok, "124.0.0.1"}
iex(3)> Exvalidate.Rules.IpV4.validating(:ipv4, 1)
{:error, :ipv4_bad_type}
For see examples go to the tests: test/rules/ipv4_test.exs