Class: Chotto::Database
- Inherits:
-
Object
- Object
- Chotto::Database
- Defined in:
- lib/chotto/database.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(path:, db_class:) ⇒ Database
constructor
A new instance of Database.
- #search_messages(query) ⇒ Object
Constructor Details
#initialize(path:, db_class:) ⇒ Database
Returns a new instance of Database.
7 8 9 |
# File 'lib/chotto/database.rb', line 7 def initialize(path:, db_class:) @db = db_class.new(path, mode: Notmuch::MODE_READ_WRITE) end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
5 6 7 |
# File 'lib/chotto/database.rb', line 5 def db @db end |
Instance Method Details
#close ⇒ Object
15 16 17 |
# File 'lib/chotto/database.rb', line 15 def close db.close end |
#search_messages(query) ⇒ Object
11 12 13 |
# File 'lib/chotto/database.rb', line 11 def (query) db.query(query). end |