def check_key(tag_or_index, method)
      if tag_or_index.is_a?(String)
        logger.warn("Parent##{method} called with an invalid tag argument: #{tag_or_index}") unless tag_or_index.tag?
      elsif tag_or_index.is_a?(Integer)
        logger.warn("Parent##{method} called with a negative Integer argument: #{tag_or_index}") if tag_or_index < 0
      else
        logger.warn("Parent##{method} called with an unexpected argument. Expected String or Integer, got: #{tag_or_index.class}")
      end
    end
def check_key(tag_or_index, method)
      if tag_or_index.is_a?(String)
        logger.warn("Parent##{method} called with an invalid tag argument: #{tag_or_index}") unless tag_or_index.tag?
      elsif tag_or_index.is_a?(Integer)
        logger.warn("Parent##{method} called with a negative Integer argument: #{tag_or_index}") if tag_or_index < 0
      else
        logger.warn("Parent##{method} called with an unexpected argument. Expected String or Integer, got: #{tag_or_index.class}")
      end
    end
Checks the given key argument and logs a warning if an obviously
 incorrect key argument is used.

 @param [String, Integer] tag_or_index the tag string or item index indentifying a given elemental
 @param [Symbol] method a representation of the method calling this method