diff options
author | Marco Ceresa <ceresa@gmail.com> | 2015-02-02 14:44:12 +0100 |
---|---|---|
committer | Marco Ceresa <ceresa@gmail.com> | 2015-02-02 14:44:12 +0100 |
commit | 52234fe47f8682c94119930771eebb00acfe1f90 (patch) | |
tree | 8a13b779af6b110d10df9b3bd42de990325dd2cf /README.rdoc | |
parent | f2080750a409c90360db24653436f1d1d026fcd3 (diff) | |
parent | f90b36f2da80070411131af985c2af9f236a1685 (diff) | |
download | ipaddress-52234fe47f8682c94119930771eebb00acfe1f90.tar.gz |
Merge pull request #57 from mikemackintosh/uint32-parse
added #ntoa unint32 -> ip and tests
Diffstat (limited to 'README.rdoc')
-rw-r--r-- | README.rdoc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/README.rdoc b/README.rdoc index 9f28191..b74c9b0 100644 --- a/README.rdoc +++ b/README.rdoc @@ -89,7 +89,7 @@ or, in a easier way, using the IPAddress parse method ip = IPAddress.parse "172.16.10.1/24" -which accepts and parses any kind of IP (IPv4, IPV6 and +which accepts and parses any kind of IP (uint32, IPv4, IPV6 and IPv4 IPv6 Mapped addresses). If you like syntactic sugar, you can use the wrapper method @@ -120,7 +120,14 @@ The new created object has prefix /32, which is the same as we created the following: host = IPAddress::IPv4.new "10.1.1.1/32" - + +You can also pass a uint32 to obtain an IPAddress::IPv4 object: + + # Create host object + ip = IPAddress 167837953 + puts ip.to_string + #=> "10.1.1.1/32" + === Handling the IPv4 address Once created, you can obtain the attributes for an IPv4 object: |