Module: Wice::ConfigurationProvider

Defined in:
lib/wice/wice_grid_misc.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.value_for(key, strict: true) ⇒ Object

:nodoc:



176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/wice/wice_grid_misc.rb', line 176

def value_for(key, strict: true) #:nodoc:
  if Wice::Defaults.const_defined?(key)
    Wice::Defaults.const_get(key)
  else
    if strict
      raise WiceGridMissingConfigurationConstantException.new("Could not find constant #{key} in the configuration file!" \
          ' It is possible that the version of WiceGrid you are using is newer than the installed configuration file in config/initializers. ' \
          "Constant Wice::Defaults::#{key} is missing  and you need to add it manually to wice_grid_config.rb or run the generator task=:\n" \
          '   rails g wice_grid:install')
    end # else nil
  end
end