def detect(object, symbol_as_object = true)
      case object
      when TrueClass, FalseClass then :boolean
      when Integer then :integer
      when Class   then object.name.downcase
      else
        if object.is_a?(Symbol) && symbol_as_object
          object
        else
          object.class.name.downcase
        end
      end
    end
def detect(object, symbol_as_object = true)
      case object
      when TrueClass, FalseClass then :boolean
      when Integer then :integer
      when Class   then object.name.downcase
      else
        if object.is_a?(Symbol) && symbol_as_object
          object
        else
          object.class.name.downcase
        end
      end
    end
Detect object type and coerce into known key type

 @param [Object] object

 @api private