# File lib/rule_engine.rb, line 207
  def max_depth *args, &block
    
    sz = args.size
    are_args = sz > 0
    md = nil
    
    if block_given?
      if are_args
        raise ArgumentError, 'max_depth called with both arguments and a block', caller
      else
        md = MaxDepths::ProcMaxDepth.new(block)
      end
    else
      case sz
      when 1
        arg = args[0]
        case arg
        when Numeric
          md = MaxDepths::StaticMaxDepth.new arg.to_i
        when Range
          md = MaxDepths::MappedMaxDepth.new arg
        else
          raise ArgumentError, 'bad argument to max_depth', caller
        end
      when 2
        arg1, arg2 = args
        if (arg1.kind_of? Range) && (arg2.kind_of? Symbol)
          md = MaxDepths::MappedMaxDepth.new arg1, arg2
        else
          raise ArgumentError, 'bad argument to max_depth', caller
        end
      else 
        raise ArgumentError, "too many (#{sz}) args passed to max_depth", caller
      end # case sz
    end # if block_given

    @__drp__max__depths << md

  end