Class: PactBroker::Api::Resources::CanIDeployPacticipantVersion

Inherits:
Matrix
  • Object
show all
Defined in:
lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb

Instance Attribute Summary

Attributes inherited from Matrix

#options, #selectors

Instance Method Summary collapse

Methods inherited from Matrix

#allowed_methods, #content_types_provided, #malformed_request?, #to_json, #to_text

Constructor Details

#initializeCanIDeployPacticipantVersion

Returns a new instance of CanIDeployPacticipantVersion.



9
10
11
12
13
14
15
16
17
18
# File 'lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb', line 9

def initialize
  super
  selector = PactBroker::Matrix::UnresolvedSelector.new(pacticipant_name: pacticipant_name, latest: true, tag: identifier_from_path[:tag])
  @options = {
    latestby: 'cvp',
    latest: true,
    tag: identifier_from_path[:to]
  }
  @selectors = [selector]
end

Instance Method Details

#policy_nameObject



24
25
26
# File 'lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb', line 24

def policy_name
  :'matrix::can_i_deploy'
end

#resource_exists?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pact_broker/api/resources/can_i_deploy_pacticipant_version.rb', line 20

def resource_exists?
  !!version
end