Skip to content

Commit 64607f9

Browse files
committed
Add offline handler
1 parent aaa130e commit 64607f9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
module Flagsmith
4+
module OfflineHandlers
5+
class LocalFileHandler
6+
7+
attr_reader :environment
8+
9+
def initialize(environment_document_path)
10+
environment_file = File.open(environment_document_path)
11+
12+
data = JSON.parse(environment_file.read, symbolize_names: true)
13+
@environment = Flagsmith::Engine::Environment.build(data)
14+
end
15+
16+
end
17+
end
18+
end

0 commit comments

Comments
 (0)