class Mobi::Mtld::Da::Carrier::CarrierData

Copyright
Author

This class is responsible for loading the data file and walking the IPV4 Radix Tries to find the properties for a given User-Agent.

Attributes

creation_date[R]
property_names[R]
property_string_names[R]
version[R]

Public Class Methods

new() click to toggle source

Public Instance Methods

ip_to_long(ip) click to toggle source

Convert the IP address string to long. www.norbauer.com/rails-consulting/notes/storing-ip-addresses-as-integers.html

ip

IP address as a string

return

IP address as a long

load_data_from_file(file_path) click to toggle source

Load carrier data file.

file_path

carrier data file

properties(key) click to toggle source

Selects a value for a given IPv4 address, traversing tree and choosing most specific value available for a given address.

key::IPv4 address to look up in integer or string form

return

Value at most specific IPv4 network in a tree for a given IPv4

address