Class: Carioca::Services::Configuration
- Inherits:
-
Object
- Object
- Carioca::Services::Configuration
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/carioca/services/configuration.rb
Overview
Service Configuration of Carioca
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#config_file ⇒ String
reading wrapper to @settings.config_file accessor.
-
#config_file=(name) ⇒ Object
writting wrapper to @settings.config_file accessor.
-
#garbage ⇒ Object
garbage service hook.
-
#initialize(_opts = {}) ⇒ Configuration
constructor
Configuration service constructor (open config).
-
#save! ⇒ TrueClass, FalseClass
Proxy to @settings.save! save the Hash(self) in the file named by @config_file.
Constructor Details
#initialize(_opts = {}) ⇒ Configuration
Configuration service constructor (open config)
140 141 142 143 144 145 146 147 |
# File 'lib/carioca/services/configuration.rb', line 140 def initialize(_opts = {}) = Methodic.(_opts) .specify_default_value :config_file => "./.config" .merge @settings = Carioca::Services::Settings.new() end |
Instance Attribute Details
#settings ⇒ Object
134 135 136 |
# File 'lib/carioca/services/configuration.rb', line 134 def settings @settings end |
Instance Method Details
#config_file ⇒ String
reading wrapper to @settings.config_file accessor
166 167 168 |
# File 'lib/carioca/services/configuration.rb', line 166 def config_file @settings.config_file end |
#config_file=(name) ⇒ Object
writting wrapper to @settings.config_file accessor
175 176 177 |
# File 'lib/carioca/services/configuration.rb', line 175 def config_file=(name) @settings.config_file = name end |
#garbage ⇒ Object
Note:
close the logger
Note:
call by Carioca::Services::Registry#close
garbage service hook
183 184 185 186 |
# File 'lib/carioca/services/configuration.rb', line 183 def garbage @settings = nil return true end |
#save! ⇒ TrueClass, FalseClass
Proxy to @settings.save!
save the Hash(self) in the file named by @config_file
156 157 158 |
# File 'lib/carioca/services/configuration.rb', line 156 def save! @settings.save! end |