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.exists?(file_path)
    @log.error("The file '%s' does not exists." % file_path)
  end
  @_file_path = file_path
  @_settings = 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 @_settings
end