Skip to content

Commit f8283e9

Browse files
committed
expose litekd configuration
1 parent c579a87 commit f8283e9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/litestack/litekd.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ module Litekd
1313
mmap_size: 32 * 1024 * 1024, # 32MB
1414
}
1515

16-
def self.connection(options = {})
16+
def self.connection()
1717
# configuration should be loaded here
1818
@@connection ||= Litekd::Connection.new(DEFAULT_OPTIONS.merge(options))
1919
end
2020

21+
def self.options
22+
@@options ||= {}
23+
end
24+
25+
def self.configure(options = {})
26+
@@options = options
27+
end
28+
2129
# scalars
2230
def self.string(key, **args) = Scalar.new(key, typed: :string, **args)
2331
def self.integer(key, **args) = Scalar.new(key, typed: :integer, **args)

test/test_litekd.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
Kredis = Litekd
77

8+
Litekd.configure({path: ":memory:"})
9+
810
class Person
911

1012
include Litekd::Attributes

0 commit comments

Comments
 (0)