Sha256: 8dae5c90915d46c787901c157ce1ae53806d4c030f411e62e5d3b0217f32a05a

Contents?: true

Size: 808 Bytes

Versions: 5

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_query_param_builder'

module Gitlab
  module Triage
    module APIQueryBuilders
      class MultiQueryParamBuilder < BaseQueryParamBuilder
        attr_reader :separator

        def initialize(param_name, param_contents, separator, allowed_values: nil)
          @separator = separator
          super(param_name, Array(param_contents), allowed_values: allowed_values)
        end

        def param_content
          param_contents.map(&:strip).join(separator)
        end

        private

        def validate_allowed_values!
          param_contents.each do |param|
            ParamsValidator.new([{ name: param_name, type: String, values: allowed_values }], { param_name => param }).validate!
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gitlab-triage-1.44.1 lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb
gitlab-triage-1.44.0 lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb
gitlab-triage-1.43.2 lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb
gitlab-triage-1.43.1 lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb
gitlab-triage-1.43.0 lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb