Class: AriFetch::AriReadFile

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/ari_fetch/ari_read_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content.



9
10
11
# File 'lib/ari_fetch/ari_read_file.rb', line 9

def content
  @content
end

#vehicles=(value) ⇒ Object

Sets the attribute vehicles

Parameters:

  • value

    the value to set the attribute vehicles to.



9
10
11
# File 'lib/ari_fetch/ari_read_file.rb', line 9

def vehicles=(value)
  @vehicles = value
end

Instance Method Details

#fetch_data(ftp_instance, include_cancel) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/ari_fetch/ari_read_file.rb', line 11

def fetch_data(ftp_instance, include_cancel)
  ftp_instance.get(name)
  @content = parse!(File.open(name, "r"))
  FileUtils.rm name
  filter_cancel_vehicles! unless include_cancel
  result.tap { data_reading_done! }
end