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) ⇒ LocalFileDataSource

Returns a new instance of LocalFileDataSource.



7
8
9
10
11
12
13
14
15
# File 'lib/configcat/localfiledatasource.rb', line 7

def initialize(file_path, override_behaviour)
  super(override_behaviour)
  if File.exists?(file_path)
    ConfigCat.logger.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



17
18
19
20
# File 'lib/configcat/localfiledatasource.rb', line 17

def get_overrides()
  reload_file_content()
  return @_settings
end