Class: CsvInZip::CsvFile
- Inherits:
-
Object
- Object
- CsvInZip::CsvFile
- Defined in:
- lib/csv_in_zip.rb
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ CsvFile
constructor
A new instance of CsvFile.
Constructor Details
#initialize(options = {}, &block) ⇒ CsvFile
Returns a new instance of CsvFile.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/csv_in_zip.rb', line 12 def initialize( = {}, &block) if [:change_headers].present? [:headers] = [:change_headers] [:remove_header_line] = true end @options = @tempfile = Tempfile.open("csv_in_zip") if [:headers].present? @tempfile.puts Array([:headers]).join(",") end instance_eval(&block) ensure @tempfile.close end |