/lib/vagrant/util/network_ip.rb
Ruby | 14 lines | 10 code | 1 blank | 3 comment | 0 complexity | cc3b5d11c5202fdc4c9f6507c48f09e8 MD5 | raw file
Possible License(s): MIT
- require "ipaddr"
- module Vagrant
- module Util
- module NetworkIP
- # Returns the network address of the given IP and subnet.
- #
- # @return [String]
- def network_address(ip, subnet)
- IPAddr.new(ip).mask(subnet).to_s
- end
- end
- end
- end