Class: HTTP::CookieJar::MozillaStore::Database

Inherits:
SQLite3::Database
  • Object
show all
Defined in:
lib/http/cookie_jar/mozilla_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ Database


45
46
47
48
49
50
51
# File 'lib/http/cookie_jar/mozilla_store.rb', line 45

def initialize(file, options = {})
  @stmts = []
  options = {
    :results_as_hash => true,
  }.update(options)
  super
end

Instance Method Details

#closeObject


61
62
63
64
65
66
67
# File 'lib/http/cookie_jar/mozilla_store.rb', line 61

def close
  return self if closed?
  @stmts.reject! { |st|
    st.closed? || st.close
  }
  super
end

#prepare(sql) ⇒ Object


53
54
55
56
57
58
59
# File 'lib/http/cookie_jar/mozilla_store.rb', line 53

def prepare(sql)
  case st = super
  when SQLite3::Statement
    @stmts << st
  end
  st
end