Class: Tornados::MaxDbFetcher
- Defined in:
- lib/tornados/max_db_fetcher.rb
Overview
Service to download geoip database file from maxmind.com: download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=YOUR_LICENSE_KEY&suffix=tar.gz
Constant Summary collapse
- GEO_API_DATABASE_URI =
"https://download.maxmind.com/app/geoip_download"
- GEO_API_DATABASE_PATH =
"/app/geoip_download"
- REQUEST_OPTION =
{ edition_id: "GeoLite2-Country", suffix: "tar.gz" }.freeze
- MAX_DB_FILE_NAME =
"GeoLite2-Country.mmdb"
- MAX_DB_STORAGE =
GZ_FILE_NAME = “max_db.tar.gz”
"./"
Instance Method Summary collapse
-
#initialize(key, max_db_storage = nil) ⇒ MaxDbFetcher
constructor
A new instance of MaxDbFetcher.
Methods inherited from Service
Constructor Details
#initialize(key, max_db_storage = nil) ⇒ MaxDbFetcher
Returns a new instance of MaxDbFetcher.
28 29 30 31 32 |
# File 'lib/tornados/max_db_fetcher.rb', line 28 def initialize(key, max_db_storage = nil) @key = key max_db_storage = max_db_storage || MAX_DB_STORAGE @max_db_file_path = File.join(max_db_storage, MAX_DB_FILE_NAME) end |