class PactBroker::Api::Resources::CanIDeployPacticipantVersionByBranchToEnvironmentBadge

Private Instance Methods

badge_url() click to toggle source
# File lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment_badge.rb, line 11
def badge_url
  if pacticipant && version && environment
    badge_service.can_i_deploy_badge_url(identifier_from_path[:branch_name], identifier_from_path[:environment_name], label, results.deployable?)
  elsif pacticipant.nil?
    badge_service.error_badge_url("pacticipant", "not found")
  elsif version.nil?
    if branch_service.find_branch(**identifier_from_path.slice(:pacticipant_name, :branch_name)).nil?
      badge_service.error_badge_url("branch", "not found")
    else
      badge_service.error_badge_url("version", "not found")
    end
  else
    badge_service.error_badge_url("environment", "not found")
  end
end