class Gitlab::Triage::GraphqlQueries::QueryParamBuilders::BaseParamBuilder

Attributes

negated[R]
param_contents[R]
param_name[R]
with_quotes[R]

Public Class Methods

new(param_name, param_contents, with_quotes: true, negated: false) click to toggle source
# File lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb, line 10
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

Public Instance Methods

build_param() click to toggle source
# File lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb, line 17
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