Class: Gitlab::Triage::GraphqlQueries::QueryParamBuilders::BaseParamBuilder
- Inherits:
-
Object
- Object
- Gitlab::Triage::GraphqlQueries::QueryParamBuilders::BaseParamBuilder
- Defined in:
- lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#negated ⇒ Object
readonly
Returns the value of attribute negated.
-
#param_contents ⇒ Object
readonly
Returns the value of attribute param_contents.
-
#param_name ⇒ Object
readonly
Returns the value of attribute param_name.
-
#with_quotes ⇒ Object
readonly
Returns the value of attribute with_quotes.
Instance Method Summary collapse
- #build_param ⇒ Object
-
#initialize(param_name, param_contents, with_quotes: true, negated: false) ⇒ BaseParamBuilder
constructor
A new instance of BaseParamBuilder.
Constructor Details
#initialize(param_name, param_contents, with_quotes: true, negated: false) ⇒ BaseParamBuilder
Returns a new instance of BaseParamBuilder.
12 13 14 15 16 17 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 12 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 |
Instance Attribute Details
#negated ⇒ Object (readonly)
Returns the value of attribute negated.
10 11 12 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 10 def negated @negated end |
#param_contents ⇒ Object (readonly)
Returns the value of attribute param_contents.
10 11 12 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 10 def param_contents @param_contents end |
#param_name ⇒ Object (readonly)
Returns the value of attribute param_name.
10 11 12 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 10 def param_name @param_name end |
#with_quotes ⇒ Object (readonly)
Returns the value of attribute with_quotes.
10 11 12 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 10 def with_quotes @with_quotes end |
Instance Method Details
#build_param ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 19 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 |