Class: ConfigCat::LocalFileDataSource

Inherits:
OverrideDataSource show all
Defined in:
lib/configcat/localfiledatasource.rb

Instance Method Summary collapse

Methods inherited from OverrideDataSource

#get_behaviour

Constructor Details

#initialize(file_path, override_behaviour, log) ⇒ LocalFileDataSource

Returns a new instance of LocalFileDataSource.



18
19
20
21
22
23
24
25
26
27
# File 'lib/configcat/localfiledatasource.rb', line 18

def initialize(file_path, override_behaviour, log)
  super(override_behaviour)
  @log = log
  if !File.exist?(file_path)
    @log.error(1300, "Cannot find the local config file '#{file_path}'. This is a path that your application provided to the ConfigCat SDK by passing it to the `LocalFileFlagOverrides.new()` method. Read more: https://configcat.com/docs/sdk-reference/ruby/#json-file")
  end
  @_file_path = file_path
  @_config = nil
  @_cached_file_stamp = 0
end

Instance Method Details

#get_overridesObject



29
30
31
32
# File 'lib/configcat/localfiledatasource.rb', line 29

def get_overrides
  reload_file_content()
  return @_config
end