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

Class Method Summary collapse

Class Attribute Details

.configObject

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

Examples:

Yourub::Config.load!(File.join("config", "yourub.yml"), 'yourub_defaults')


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 = valid_options(hash)
  @config = OpenStruct.new opt
end