Class: Sequel::Dataset

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/export.rb

Instance Method Summary collapse

Instance Method Details

#export(fd = $stdout, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/extensions/export.rb', line 15

def export(fd = $stdout, options = {})

  opts[:delimiter]  = options[:delimiter] || "\t"
  opts[:quote_char] = options[:quote_char] || ''
  opts[:headers]    = options[:headers] != false
  opts[:paginate]   = options[:paginate] || false
  opts[:page_size]  = options[:page_size] || 5000
  
  Sequel.extension :pagination if opts[:paginate]

  Sequel::Export::Writer.new(fd, self, opts).output
end