Sha256: 0b7b15edb7000d6da8c1d97c5a517881557acddcede8918c81c7375143a0f7c2
Contents?: true
Size: 611 Bytes
Versions: 1
Compression:
Stored size: 611 Bytes
Contents
class Ip2LocationRecord <BinData::Record def self.init(database, ip_version) Ip2LocationRecord.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 } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ip2location_ruby-0.1.2 | lib/ip2location_ruby/ip2location_record.rb |