Class: SettingsProvider

Inherits:
Object
  • Object
show all
Defined in:
app/core/settings.rb

Overview

The settings provider is responsible for reading the settings from the config file and providing them to clients

Instance Method Summary collapse

Constructor Details

#initialize(fs = File) ⇒ SettingsProvider

Returns a new instance of SettingsProvider.



24
25
26
# File 'app/core/settings.rb', line 24

def initialize(fs=File)
  @filesystem = fs
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_id) ⇒ Object



28
29
30
# File 'app/core/settings.rb', line 28

def method_missing(method_id)
  load_confs[method_id.to_s].to_i
end

Instance Method Details

#active_reporter_idsObject



32
33
34
# File 'app/core/settings.rb', line 32

def active_reporter_ids
  load_confs.keys - ['package_size', 'update_interval']
end