class PactBroker::Client::Pacticipants2::Describe

Private Instance Methods

do_call() click to toggle source
# File lib/pact_broker/client/pacticipants/describe.rb, line 11
def do_call
  PactBroker::Client::CommandResult.new(true, result_message)
end
pacticipant_entity() click to toggle source
# File lib/pact_broker/client/pacticipants/describe.rb, line 15
def pacticipant_entity
  @pacticipant_entity ||= index_resource._link('pb:pacticipant').expand('pacticipant' => params[:name]).get!
end
result_message() click to toggle source
# File lib/pact_broker/client/pacticipants/describe.rb, line 19
def result_message
  if json_output?
    pacticipant_entity.response.raw_body
  else
    properties = pacticipant_entity.response.body.except("_links", "_embedded")
    if pacticipant_entity._embedded && pacticipant_entity._embedded["labels"] && pacticipant_entity._embedded["labels"].any?
      properties["labels"] = pacticipant_entity._embedded["labels"]
    end
    PactBroker::Client::DescribeTextFormatter.call(properties)
  end
end