Class: PactBroker::Api::Resources::CanIDeploy
- Inherits:
-
Matrix
- Object
- BaseResource
- Matrix
- PactBroker::Api::Resources::CanIDeploy
show all
- Defined in:
- lib/pact_broker/api/resources/can_i_deploy.rb
Instance Method Summary
collapse
Methods inherited from Matrix
#allowed_methods, #content_types_provided, #results, #to_json, #to_text
Constructor Details
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
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?
set_json_validation_error_messages(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
|
#policy_record ⇒ Object
28
29
30
|
# File 'lib/pact_broker/api/resources/can_i_deploy.rb', line 28
def policy_record
selectors
end
|