class RBatch::ConfigElementHash

Public Class Methods

new(hash) click to toggle source
# File lib/rbatch/config.rb, line 85
def initialize(hash)
  if hash
    hash.each_key do |key|
      self[key] = Config.parse(hash[key])
    end
  end
end

Public Instance Methods

[](key) click to toggle source
Calls superclass method
# File lib/rbatch/config.rb, line 93
def[](key)
  if self.has_key?(key)
    super
  else
    if key.class == Symbol
      raise RBatch::ConfigException, "Value of key(:#{key} (Symbol)) does not exist. By any chance, dou you mistake key class Symbol for String?"
    elsif key.class == String
      raise RBatch::ConfigException, "Value of key(\"#{key}\" (String)) does not exist"
    else
      raise RBatch::ConfigException, "Value of key(#{key}) does not exist."
    end
    raise
  end
end