def method_missing(method, *args)
      method = method.to_s
      return if method == 'default_key'
      value = self[method]
      case args.size
      when 0  # e.g.: RConfig.application.method
        value
      when 1  # e.g.: RConfig.application.method(one_arg)
        value.send(args[0])
      else    # e.g.: RConfig.application.method(arg_one, args_two, ...)
        value[args]
      end
    end
def method_missing(method, *args)
      method = method.to_s
      return if method == 'default_key'
      value = self[method]
      case args.size
      when 0  # e.g.: RConfig.application.method
        value
      when 1  # e.g.: RConfig.application.method(one_arg)
        value.send(args[0])
      else    # e.g.: RConfig.application.method(arg_one, args_two, ...)
        value[args]
      end
    end
Dotted notation can be used with arguments (useful for creating mock objects)
 in the YAML file the method name is a key, argument(s) form a nested key,
 so that the correct value is retrieved and returned.

 For example loading to variable foo a yaml file that looks like:
 customer:
   id: 12345678
   verified:
     phone: verified
     :address: info_not_available
     ? [name, employer]
     : not_verified

 Allows the following calls:
 foo.customer.id                 => 12345678
 foo.customer.verified.phone     => verified
 foo.customer.verified("phone")  => verified
 foo.customer.verified(:address) => info_not_available
 foo.customer.verified("name", "employer") => not_verified

 Note that :address is specified as a symbol, where phone is just a string.
 Depending on what kind of parameter the method being mocked out is going
 to be called with, define in the YAML file either a string or a symbol.
 This also works inside the composite array keys.