Class: DataCollector::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/data_collector/config_file.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



32
33
34
35
# File 'lib/data_collector/config_file.rb', line 32

def self.[](key)
  init
  @config[key]
end

.[]=(key, value) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/data_collector/config_file.rb', line 37

def self.[]=(key, value)
  init
  @config[key] = value
  File.open("#{path}/#{@config_file_name}", 'w') do |f|
    f.puts @config.to_yaml
  end
end

.include?(key) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
48
# File 'lib/data_collector/config_file.rb', line 45

def self.include?(key)
  init
  @config.include?(key)
end

.keysObject



50
51
52
53
# File 'lib/data_collector/config_file.rb', line 50

def self.keys
  init
  @config.keys
end

.nameObject



16
17
18
# File 'lib/data_collector/config_file.rb', line 16

def self.name
  @config_file_name
end

.name=(config_file_name) ⇒ Object



20
21
22
# File 'lib/data_collector/config_file.rb', line 20

def self.name=(config_file_name)
  @config_file_name = config_file_name
end

.pathObject



24
25
26
# File 'lib/data_collector/config_file.rb', line 24

def self.path
  @config_file_path
end

.path=(config_file_path) ⇒ Object



28
29
30
# File 'lib/data_collector/config_file.rb', line 28

def self.path=(config_file_path)
  @config_file_path = config_file_path
end

.versionObject



12
13
14
# File 'lib/data_collector/config_file.rb', line 12

def self.version
  '0.0.3'
end