Module: Yourub::Config
- Extended by:
- Forwardable
- Defined in:
- lib/yourub/config.rb
Constant Summary collapse
- MANDATORY_KEYS =
[:developer_key, :application_name, :application_version, :log_level]
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
-
.load!(file_path, environment) ⇒ Object
It loads the configuration file this method is used in the railtie.rb and in the default.rb files.
- .override_config_file(hash) ⇒ Object
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/yourub/config.rb', line 10 def config @config end |
Class Method Details
.load!(file_path, environment) ⇒ Object
It loads the configuration file this method is used in the railtie.rb and in the default.rb files
21 22 23 |
# File 'lib/yourub/config.rb', line 21 def load!(file_path, environment) @config = OpenStruct.new YAML.load_file(file_path)[environment] end |
.override_config_file(hash) ⇒ Object
25 26 27 28 |
# File 'lib/yourub/config.rb', line 25 def override_config_file(hash) opt = (hash) @config = OpenStruct.new opt end |