Class: Solis::ConfigFile

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

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



31
32
33
34
# File 'lib/solis/config_file.rb', line 31

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

.[]=(key, value) ⇒ Object



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

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

.configObject



49
50
51
52
# File 'lib/solis/config_file.rb', line 49

def self.config
  init
  @config
end

.include?(key) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
47
# File 'lib/solis/config_file.rb', line 44

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

.keysObject



54
55
56
57
# File 'lib/solis/config_file.rb', line 54

def self.keys
  init
  @config.keys
end

.nameObject



15
16
17
# File 'lib/solis/config_file.rb', line 15

def self.name
  @config_file_name
end

.name=(config_file_name) ⇒ Object



19
20
21
# File 'lib/solis/config_file.rb', line 19

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

.pathObject



23
24
25
# File 'lib/solis/config_file.rb', line 23

def self.path
  @config_file_path
end

.path=(config_file_path) ⇒ Object



27
28
29
# File 'lib/solis/config_file.rb', line 27

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

.versionObject



11
12
13
# File 'lib/solis/config_file.rb', line 11

def self.version
  "0.0.4"
end