def validate(breadcrumb)
      # Check name length
      if breadcrumb.name.size > Bugsnag::Breadcrumbs::MAX_NAME_LENGTH
        @configuration.debug("Breadcrumb name trimmed to length #{Bugsnag::Breadcrumbs::MAX_NAME_LENGTH}.  Original name: #{breadcrumb.name}")
        breadcrumb.name = breadcrumb.name.slice(0...Bugsnag::Breadcrumbs::MAX_NAME_LENGTH)
      end

      # Check meta_data hash doesn't contain complex values
      breadcrumb.meta_data = breadcrumb.meta_data.select do |k, v|
        if valid_meta_data_type?(v)
          true
        else
          @configuration.debug("Breadcrumb #{breadcrumb.name} meta_data #{k}:#{v.class} has been dropped for having an invalid data type")
          false
        end
      end

      # Check type is valid, set to manual otherwise
      unless Bugsnag::Breadcrumbs::VALID_BREADCRUMB_TYPES.include?(breadcrumb.type)
        @configuration.debug("Invalid type: #{breadcrumb.type} for breadcrumb: #{breadcrumb.name}, defaulting to #{Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE}")
        breadcrumb.type = Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE
      end

      # If auto is true, check type is in enabled_automatic_breadcrumb_types
      return unless breadcrumb.auto && !@configuration.enabled_automatic_breadcrumb_types.include?(breadcrumb.type)

      @configuration.debug("Automatic breadcrumb of type #{breadcrumb.type} ignored: #{breadcrumb.name}")
      breadcrumb.ignore!
    end
def validate(breadcrumb)
      # Check name length
      if breadcrumb.name.size > Bugsnag::Breadcrumbs::MAX_NAME_LENGTH
        @configuration.debug("Breadcrumb name trimmed to length #{Bugsnag::Breadcrumbs::MAX_NAME_LENGTH}.  Original name: #{breadcrumb.name}")
        breadcrumb.name = breadcrumb.name.slice(0...Bugsnag::Breadcrumbs::MAX_NAME_LENGTH)
      end

      # Check meta_data hash doesn't contain complex values
      breadcrumb.meta_data = breadcrumb.meta_data.select do |k, v|
        if valid_meta_data_type?(v)
          true
        else
          @configuration.debug("Breadcrumb #{breadcrumb.name} meta_data #{k}:#{v.class} has been dropped for having an invalid data type")
          false
        end
      end

      # Check type is valid, set to manual otherwise
      unless Bugsnag::Breadcrumbs::VALID_BREADCRUMB_TYPES.include?(breadcrumb.type)
        @configuration.debug("Invalid type: #{breadcrumb.type} for breadcrumb: #{breadcrumb.name}, defaulting to #{Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE}")
        breadcrumb.type = Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE
      end

      # If auto is true, check type is in enabled_automatic_breadcrumb_types
      return unless breadcrumb.auto && !@configuration.enabled_automatic_breadcrumb_types.include?(breadcrumb.type)

      @configuration.debug("Automatic breadcrumb of type #{breadcrumb.type} ignored: #{breadcrumb.name}")
      breadcrumb.ignore!
    end
@param configuration [Bugsnag::Configuration] The current configuration

 Validates a given breadcrumb.

 @param breadcrumb [Bugsnag::Breadcrumbs::Breadcrumb] the breadcrumb to be validated