Class: Sqldump::Dumper

Inherits:
Object
  • Object
show all
Defined in:
lib/sqldump/dumper.rb

Instance Method Summary collapse

Constructor Details

#initialize(dbh, options) ⇒ Dumper

Returns a new instance of Dumper.



5
6
7
8
# File 'lib/sqldump/dumper.rb', line 5

def initialize(dbh, options)
  @dbh = dbh
  @options = options
end

Instance Method Details

#dumpObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/sqldump/dumper.rb', line 10

def dump
  begin
    sth = @dbh.execute(@options.sql)
    yield sth

  ensure
    sth.finish if sth

  end
end