Class: PactBroker::Api::Contracts::PutPacticipantNameContract

Inherits:
PacticipantNameContract show all
Defined in:
lib/pact_broker/api/contracts/put_pact_params_contract.rb

Instance Method Summary collapse

Methods inherited from PacticipantNameContract

#blank?, #empty?

Methods included from Messages

#message, #potential_duplicate_pacticipant_message, #validation_message

Instance Method Details

#name_in_path_matches_name_in_pactObject



18
19
20
21
22
23
24
# File 'lib/pact_broker/api/contracts/put_pact_params_contract.rb', line 18

def name_in_path_matches_name_in_pact
  if present?(name) && present?(name_in_pact)
    if name != name_in_pact
      errors.add(:name, validation_message('pacticipant_name_mismatch', message_args))
    end
  end
end

#present?(string) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/pact_broker/api/contracts/put_pact_params_contract.rb', line 26

def present? string
  string && !blank?(string)
end