Class: RadCoreRails::ZipImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/rad_core_rails/zip_importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ ZipImporter

Returns a new instance of ZipImporter.



7
8
9
# File 'lib/rad_core_rails/zip_importer.rb', line 7

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



5
6
7
# File 'lib/rad_core_rails/zip_importer.rb', line 5

def file_path
  @file_path
end

#zip_codes_dataObject (readonly)

Returns the value of attribute zip_codes_data.



5
6
7
# File 'lib/rad_core_rails/zip_importer.rb', line 5

def zip_codes_data
  @zip_codes_data
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rad_core_rails/zip_importer.rb', line 11

def call
  puts "Parsing file..."
  parse_data
  puts "Parsing completed."

  puts "Importing data..."
  import_data!
  puts "Successfully imported!"

  true
end