Class: Coral::Config::Collection
- Inherits:
-
Object
- Object
- Coral::Config::Collection
- Defined in:
- lib/coral_core/config/collection.rb
Constant Summary collapse
- @@properties =
Property accessor / modifiers
{}
Class Method Summary collapse
-
.all ⇒ Object
—.
-
.clear ⇒ Object
—.
-
.delete(name) ⇒ Object
—.
-
.get(name) ⇒ Object
—.
-
.save ⇒ Object
—.
-
.set(name, value) ⇒ Object
—.
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/coral_core/config/collection.rb', line 13 def self.all return @@properties end |
.clear ⇒ Object
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 |
.save ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/coral_core/config/collection.rb', line 43 def self.save = Options.get(:coral_log) unless Util::Data.empty?([:config_log]) config_log = [:config_log] if [: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 |