Class: BridgeBlueprint::DataDump

Inherits:
Object
  • Object
show all
Defined in:
lib/bridge_blueprint/data_dump.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DataDump

Returns a new instance of DataDump.



10
11
12
13
# File 'lib/bridge_blueprint/data_dump.rb', line 10

def initialize(path)
  @path = path
  raise "File not found #{path}" unless File.exist?(path)
end

Instance Method Details

#each_row(name) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/bridge_blueprint/data_dump.rb', line 15

def each_row(name)
  extract_from_zip("#{name}.csv") do |file|
    CSV.foreach(file, headers: true) do |row|
      yield(row)
    end
  end
end