Class: XapianDb::InMemoryDatabase
- Defined in:
- lib/xapian_db/database.rb
Overview
In Memory database
Instance Attribute Summary
Attributes inherited from Database
Instance Method Summary collapse
-
#commit ⇒ Object
Commit all pending changes.
-
#initialize ⇒ InMemoryDatabase
constructor
A new instance of InMemoryDatabase.
-
#reset ⇒ Object
Reset (empty) the database.
-
#writer ⇒ Xapian::WritableDatabase
Get the writer to write to the database.
Methods inherited from Database
#delete_doc_with_unique_term, #delete_docs_of_class, #facets, #find_similar_to, #search, #size, #store_doc
Methods included from Utilities
#assert_valid_keys, #camelize, #constantize
Constructor Details
#initialize ⇒ InMemoryDatabase
Returns a new instance of InMemoryDatabase.
179 180 181 182 |
# File 'lib/xapian_db/database.rb', line 179 def initialize @writer ||= Xapian::inmemory_open @reader = @writer end |
Instance Method Details
#commit ⇒ Object
Commit all pending changes
191 192 193 |
# File 'lib/xapian_db/database.rb', line 191 def commit # Nothing to do for an in memory database end |
#reset ⇒ Object
Reset (empty) the database
196 197 198 199 |
# File 'lib/xapian_db/database.rb', line 196 def reset @writer = Xapian::inmemory_open @reader = @writer end |
#writer ⇒ Xapian::WritableDatabase
Get the writer to write to the database
186 187 188 |
# File 'lib/xapian_db/database.rb', line 186 def writer @writer end |