From 955739e2a7be70e6abf7e95710ffe0f4a9c64481 Mon Sep 17 00:00:00 2001 From: mms Date: Tue, 12 Nov 2024 21:26:10 +0100 Subject: feat: rename modules --- lib/osugiru/database.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/osugiru/database.rb (limited to 'lib/osugiru/database.rb') diff --git a/lib/osugiru/database.rb b/lib/osugiru/database.rb new file mode 100644 index 0000000..d014c94 --- /dev/null +++ b/lib/osugiru/database.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Osugiru + class Database + attr_reader :db + + def initialize(path:) + @db = ::Notmuch::Database.new(path) + end + + def query(query) + db.query(query) + end + + def search_messages(query) + query(query).search_messages + end + end +end -- cgit v1.2.3