Sha256: c40c613e2580b7105635d0c4e65833352ab295e329924025ca3c0a22e7a96e32

Contents?: true

Size: 819 Bytes

Versions: 20

Compression:

Stored size: 819 Bytes

Contents

require_relative '../../utils'

module Gitlab
  module Triage
    module GraphqlQueries
      module QueryParamBuilders
        class BaseParamBuilder
          attr_reader :param_name, :param_contents, :with_quotes, :negated

          def initialize(param_name, param_contents, with_quotes: true, negated: false)
            @param_name = param_name
            @param_contents = param_contents.to_s.strip
            @with_quotes = with_quotes
            @negated = negated
          end

          def build_param
            contents = with_quotes ? Utils.graphql_quote(param_contents) : param_contents

            if negated
              ", not: { #{param_name}: #{contents} }"
            else
              ", #{param_name}: #{contents}"
            end
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
gitlab-triage-1.42.2 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.42.1 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.42.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.41.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.40.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.30.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.29.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
payping-gitlab-triage-0.1.3 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
payping-gitlab-triage-0.1.2 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
payping-gitlab-triage-0.1.1 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.28.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.27.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.26.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.25.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.24.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.23.1 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.23.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.22.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.21.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
gitlab-triage-1.20.0 lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb