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.
10 11 12 13 14 15 |
# 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 |
Instance Attribute Details
#negated ⇒ Object (readonly)
Returns the value of attribute negated.
8 9 10 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 8 def negated @negated end |
#param_contents ⇒ Object (readonly)
Returns the value of attribute param_contents.
8 9 10 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 8 def param_contents @param_contents end |
#param_name ⇒ Object (readonly)
Returns the value of attribute param_name.
8 9 10 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 8 def param_name @param_name end |
#with_quotes ⇒ Object (readonly)
Returns the value of attribute with_quotes.
8 9 10 |
# File 'lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb', line 8 def with_quotes @with_quotes end |
Instance Method Details
#build_param ⇒ Object
17 18 19 20 21 22 23 24 25 |
# 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 |