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:



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/wice/wice_grid_misc.rb', line 98

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