code: public function setMaxRating($rating)
  	{
  		// Wipe out the param cache.
  		$this->param_cache = NULL;
  
  		$rating = strtolower($rating);
  		$valid_ratings = array('g' => 1, 'pg' => 1, 'r' => 1, 'x' => 1);
  		if(!isset($valid_ratings[$rating]))
  		{
  			throw new InvalidArgumentException(sprintf('Invalid rating "%s" specified, only "g", "pg", "r", or "x" are allowed to be used.', $rating));
  		}
  
  		$this->max_rating = $rating;
  
  		return $this;
  	}
docs: Set the maximum allowed rating for avatars.
  @param string $rating - The maximum rating to use for avatars ('g', 'pg', 'r', 'x').
  @return \thomaswelton\GravatarLib\Gravatar - Provides a fluent interface.
  
  @throws \InvalidArgumentException