Class: Coral::Config::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/coral_core/config/collection.rb

Constant Summary collapse

@@properties =

Property accessor / modifiers

{}

Class Method Summary collapse

Class Method Details

.allObject




13
14
15
# File 'lib/coral_core/config/collection.rb', line 13

def self.all
  return @@properties
end

.clearObject




37
38
39
# File 'lib/coral_core/config/collection.rb', line 37

def self.clear
  @@properties = {}
end

.delete(name) ⇒ Object




31
32
33
# File 'lib/coral_core/config/collection.rb', line 31

def self.delete(name)
  @@properties.delete(name.to_sym)
end

.get(name) ⇒ Object




19
20
21
# File 'lib/coral_core/config/collection.rb', line 19

def self.get(name)
  return @@properties[name.to_sym]
end

.saveObject




43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/coral_core/config/collection.rb', line 43

def self.save
  log_options = Options.get(:coral_log)
  
  unless Util::Data.empty?(log_options[:config_log])
    config_log = log_options[:config_log]
    
    if log_options[:config_store]
      Util::Disk.write(config_log, MultiJson.dump(@@properties, :pretty => true))
      Util::Disk.close(config_log)
    end
  end
end

.set(name, value) ⇒ Object




25
26
27
# File 'lib/coral_core/config/collection.rb', line 25

def self.set(name, value)
  @@properties[name.to_sym] = value
end