Class: Gitlab::Triage::APIQueryBuilders::MultiQueryParamBuilder
- Inherits:
-
BaseQueryParamBuilder
- Object
- BaseQueryParamBuilder
- Gitlab::Triage::APIQueryBuilders::MultiQueryParamBuilder
- Defined in:
- lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb
Instance Attribute Summary collapse
-
#separator ⇒ Object
readonly
Returns the value of attribute separator.
Attributes inherited from BaseQueryParamBuilder
#allowed_values, #param_contents, #param_name
Instance Method Summary collapse
-
#initialize(param_name, param_contents, separator, allowed_values: nil) ⇒ MultiQueryParamBuilder
constructor
A new instance of MultiQueryParamBuilder.
- #param_content ⇒ Object
- #validate_allowed_values! ⇒ Object private
Methods inherited from BaseQueryParamBuilder
Constructor Details
#initialize(param_name, param_contents, separator, allowed_values: nil) ⇒ MultiQueryParamBuilder
Returns a new instance of MultiQueryParamBuilder.
9 10 11 12 |
# File 'lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb', line 9 def initialize(param_name, param_contents, separator, allowed_values: nil) @separator = separator super(param_name, Array(param_contents), allowed_values: allowed_values) end |
Instance Attribute Details
#separator ⇒ Object (readonly)
Returns the value of attribute separator.
7 8 9 |
# File 'lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb', line 7 def separator @separator end |
Instance Method Details
#param_content ⇒ Object
14 15 16 |
# File 'lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb', line 14 def param_content param_contents.map(&:strip).join(separator) end |
#validate_allowed_values! ⇒ Object (private)
20 21 22 23 24 |
# File 'lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb', line 20 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 |