Encode a method (ruby) that receives as a parameter an array of IP's and return an array with the same set of IP's sorted in ascending but considering the subnet.