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



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

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)


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

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