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

Returns a new instance of Database.



42
43
44
45
46
47
48
# File 'lib/http/cookie_jar/mozilla_store.rb', line 42

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

Instance Method Details

#closeObject



58
59
60
61
62
63
64
# File 'lib/http/cookie_jar/mozilla_store.rb', line 58

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

#prepare(sql) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/http/cookie_jar/mozilla_store.rb', line 50

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