Class: Tornados::MaxDbFetcher

Inherits:
Service
  • Object
show all
Defined in:
lib/tornados/max_db_fetcher.rb

Overview

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

Methods inherited from Service

call

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