Sha256: 4e2d14767eebb0498689c10bbb6aa6690e7bd0c67b07827ee49fe52677f4ce7b
Contents?: true
Size: 588 Bytes
Versions: 2
Compression:
Stored size: 588 Bytes
Contents
class I2pDbConfig COLUMNS = { :COUNTRY => [0, 2, 3, 3, 3], :REGION => [0, 0, 0, 4, 4], :CITY => [0, 0, 0, 5, 5], :ISP => [0, 0, 0, 0, 6], :PROXYTYPE => [0, 0, 2, 2, 2] } def self.setup_database(db_index) # strip all 0 value & downcase keys cols = COLUMNS.inject({}) {|memo, (key, value)| (memo[key.to_s.downcase.to_sym] = value[db_index] if value[db_index] > 0) memo } # order by value col_array = cols.sort_by {|key,value| value} end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ip2proxy_ruby-1.0.3 | lib/ip2proxy_ruby/i2p_database_config.rb |
ip2proxy_ruby-1.0.2 | lib/ip2proxy_ruby/i2p_database_config.rb |