Sha256: 9077d05581f6ce6753367f34cc9bc8c3d97910fbbcb055aaa745d239a4960027
Contents?: true
Size: 626 Bytes
Versions: 3
Compression:
Stored size: 626 Bytes
Contents
class Ip2LocationRecord def self.init(database, ip_version) cls = Class.new(BinData::Record) cls.class_eval { endian :little i2l_ip_data :ip_from, :ip_version => ip_version database.each do |col| if [:latitude, :longitude,:elevation].include? col.first i2l_float_data col.first elsif col.first == :country i2l_string_data :country_short i2l_string_data :country_long, :country_long => true else i2l_string_data col.first end end i2l_ip_data :ip_to, :ip_version => ip_version } cls end end
Version data entries
3 entries across 3 versions & 1 rubygems