summaryrefslogtreecommitdiff
path: root/README.rdoc
diff options
context:
space:
mode:
authorMike Mackintosh <m@zyp.io>2015-01-26 16:21:55 -0500
committerMike Mackintosh <m@zyp.io>2015-01-26 16:21:55 -0500
commitf90b36f2da80070411131af985c2af9f236a1685 (patch)
tree223eb31957ab6a3b548aaf6e086c96af1c9b7e6d /README.rdoc
parentce5b524748759d23790a710fd1adcca6a547d91d (diff)
downloadipaddress-f90b36f2da80070411131af985c2af9f236a1685.tar.gz
added #ntoa unint32 -> ip and tests
Diffstat (limited to 'README.rdoc')
-rw-r--r--README.rdoc11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.rdoc b/README.rdoc
index 0419f6c..e6f6185 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -87,7 +87,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
@@ -118,7 +118,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: