Class: FBO::RemoteFile

Inherits:
File
  • Object
show all
Defined in:
lib/fbo/remote_file.rb

Constant Summary collapse

FTP_SERVER =
'ftp.fbo.gov'
TMP_DIR =
'/tmp/fbo'

Instance Attribute Summary

Attributes inherited from File

#file

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from File

#contents, filename_for_date, #gets

Constructor Details

#initialize(filename, options = {}) ⇒ RemoteFile



16
17
18
19
20
# File 'lib/fbo/remote_file.rb', line 16

def initialize(filename, options = {})
  @filename = filename
  @tmp_dir = options[:tmp_dir] || TMP_DIR
  @file = fetch_file(filename)
end

Class Method Details

.for_date(date, options = {}) ⇒ Object



10
11
12
13
# File 'lib/fbo/remote_file.rb', line 10

def for_date(date, options = {})
  filename = filename_for_date(date)
  FBO::RemoteFile.new(filename, options)
end