Class: SearchApnic::File

Inherits:
Object
  • Object
show all
Defined in:
lib/search_apnic/file.rb

Constant Summary collapse

HOST =
'ftp.apnic.net'
PATH =
'/stats/apnic/delegated-apnic-latest'
CACHE_FILE =
'/tmp/apnic-latest.txt'

Instance Method Summary collapse

Instance Method Details

#get_pathObject



10
11
12
13
# File 'lib/search_apnic/file.rb', line 10

def get_path
  file = cache_file
  fresh?(file) ? file : get
end

#headObject



15
16
17
# File 'lib/search_apnic/file.rb', line 15

def head
  Net::HTTP.new(HOST).head(PATH)
end