class PactBroker::Matrix::ParseCanIDeployQuery
Public Class Methods
Source
# File lib/pact_broker/matrix/parse_can_i_deploy_query.rb, line 8 def self.call params selector = PactBroker::Matrix::UnresolvedSelector.new options = { latestby: "cvp" } if params[:pacticipant].is_a?(String) selector.pacticipant_name = params[:pacticipant] end if params[:version].is_a?(String) selector.pacticipant_version_number = params[:version] end if params[:to].is_a?(String) options[:tag] = params[:to] options[:latest] = true end if params[:environment].is_a?(String) options[:environment_name] = params[:environment] end if params[:ignore].is_a?(Array) options[:ignore_selectors] = params[:ignore].collect do | param | if param.is_a?(String) PactBroker::Matrix::UnresolvedSelector.new(pacticipant_name: param) elsif param.is_a?(Hash) && param.key?(:pacticipant) PactBroker::Matrix::UnresolvedSelector.new({ pacticipant_name: param[:pacticipant], pacticipant_version_number: param[:version] }.compact) end end.compact else options[:ignore_selectors] = [] end return [selector], options end
rubocop: disable Metrics/CyclomaticComplexity