Class: Flagsmith::OfflineHandlers::LocalFileHandler
- Inherits:
-
Object
- Object
- Flagsmith::OfflineHandlers::LocalFileHandler
- Defined in:
- lib/flagsmith/sdk/offline_handlers.rb
Overview
Provides the offline_handler to the Flagsmith::Client.
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize(environment_document_path) ⇒ LocalFileHandler
constructor
A new instance of LocalFileHandler.
Constructor Details
#initialize(environment_document_path) ⇒ LocalFileHandler
Returns a new instance of LocalFileHandler.
9 10 11 12 13 14 |
# File 'lib/flagsmith/sdk/offline_handlers.rb', line 9 def initialize(environment_document_path) environment_file = File.open(environment_document_path) data = JSON.parse(environment_file.read, symbolize_names: true) @environment = Flagsmith::Engine::Environment.build(data) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/flagsmith/sdk/offline_handlers.rb', line 7 def environment @environment end |