ruby-radix is an implementation of a radix tree data structure for the storage and retrieval of IPv4 and IPv6 network prefixes. The radix tree is the data structure most commonly used for routing table lookups. It efficiently stores network prefixes of varying lengths and allows fast lookups of containing networks.
Gemfile gem 'ruby-radix', '~> 0.0.2'
install gem install ruby-radix -v 0.0.2