Sha256: 7432cc472605846307d0d76416a4ff43e448e8ee464bddd5aed3239b959f2f56

Contents?: true

Size: 532 Bytes

Versions: 5

Compression:

Stored size: 532 Bytes

Contents

class Ip2ProxyRecord 
  def self.init(database, ip_version)
    cls = Class.new(BinData::Record)
    cls.class_eval {
      endian :little
      i2p_ip_data :ip_from, :ip_version => ip_version
      database.each do |col|
        if col.first == :country
          i2p_string_data :country_short
          i2p_string_data :country_long, :country_long => true
        else
          i2p_string_data col.first
        end
      end
      
      i2p_ip_data :ip_to, :ip_version => ip_version
    }
    cls 
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ip2proxy_ruby-3.0.1 lib/ip2proxy_ruby/ip2proxy_record.rb
ip2proxy_ruby-3.0.0 lib/ip2proxy_ruby/ip2proxy_record.rb
ip2proxy_ruby-2.1.0 lib/ip2proxy_ruby/ip2proxy_record.rb
ip2proxy_ruby-2.0.0 lib/ip2proxy_ruby/ip2proxy_record.rb
ip2proxy_ruby-1.0.4 lib/ip2proxy_ruby/ip2proxy_record.rb