Class: PactBroker::Api::Resources::CanIDeploy
- Defined in:
- lib/pact_broker/api/resources/can_i_deploy.rb
Instance Method Summary collapse
-
#initialize ⇒ CanIDeploy
constructor
A new instance of CanIDeploy.
- #malformed_request? ⇒ Boolean
- #policy_name ⇒ Object
Methods inherited from Matrix
#allowed_methods, #content_types_provided, #results, #to_json, #to_text
Constructor Details
#initialize ⇒ CanIDeploy
Returns a new instance of CanIDeploy.
9 10 11 12 13 |
# File 'lib/pact_broker/api/resources/can_i_deploy.rb', line 9 def initialize super @query_params = JSON.parse(Rack::Utils.parse_nested_query(request.uri.query).to_json, symbolize_names: true) @selectors, @options = PactBroker::Matrix::ParseCanIDeployQuery.call(query_params) end |
Instance Method Details
#malformed_request? ⇒ Boolean
15 16 17 18 19 20 21 22 |
# File 'lib/pact_broker/api/resources/can_i_deploy.rb', line 15 def malformed_request? if (errors = query_schema.call(query_params)).any? (errors) true else false end end |
#policy_name ⇒ Object
24 25 26 |
# File 'lib/pact_broker/api/resources/can_i_deploy.rb', line 24 def policy_name :'matrix::can_i_deploy' end |