Module: PgCsv::Base
- Included in:
- PgCsv
- Defined in:
- lib/pg_csv.rb
Instance Method Summary collapse
-
#export(to = nil, opts = {}, &row_proc) ⇒ Object
do export :to - filename or stream.
- #initialize(opts = {}) ⇒ Object
Instance Method Details
#export(to = nil, opts = {}, &row_proc) ⇒ Object
do export :to - filename or stream
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pg_csv.rb', line 13 def export(to = nil, opts = {}, &row_proc) @row_proc = row_proc @local_options = opts raise ":connection should be" unless connection raise ":sql should be" unless sql with_temp_file?(to, temp_file, temp_dir) do |dest| export_to(dest) end end |
#initialize(opts = {}) ⇒ Object
8 9 10 |
# File 'lib/pg_csv.rb', line 8 def initialize(opts = {}) @options = opts end |