diff --git a/lib/litestack/litekd.rb b/lib/litestack/litekd.rb index bb33e1f..88c5600 100644 --- a/lib/litestack/litekd.rb +++ b/lib/litestack/litekd.rb @@ -13,11 +13,19 @@ module Litekd mmap_size: 32 * 1024 * 1024, # 32MB } - def self.connection(options = {}) + def self.connection() # configuration should be loaded here @@connection ||= Litekd::Connection.new(DEFAULT_OPTIONS.merge(options)) end + def self.options + @@options ||= {} + end + + def self.configure(options = {}) + @@options = options + end + # scalars def self.string(key, **args) = Scalar.new(key, typed: :string, **args) def self.integer(key, **args) = Scalar.new(key, typed: :integer, **args) diff --git a/test/test_litekd.rb b/test/test_litekd.rb index 3aa30c9..7487d5b 100644 --- a/test/test_litekd.rb +++ b/test/test_litekd.rb @@ -5,6 +5,8 @@ Kredis = Litekd +Litekd.configure({path: ":memory:"}) + class Person include Litekd::Attributes