class PactBroker::Api::Resources::ProviderPacts

Public Instance Methods

allowed_methods() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 14
def allowed_methods
  ["GET", "OPTIONS"]
end
content_types_provided() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 10
def content_types_provided
  [["application/hal+json", :to_json]]
end
policy_name() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 22
def policy_name
  :'pacts::pacts'
end
resource_exists?() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 18
def resource_exists?
  !!provider
end
to_json() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 26
def to_json
  decorator_class(:provider_pacts_decorator).new(pacts).to_json(decorator_options(identifier_from_path.merge(title: resource_title)))
end

Private Instance Methods

pacts() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 32
def pacts
  pact_service.find_pact_versions_for_provider provider_name, tag: identifier_from_path[:tag]
end
resource_title() click to toggle source
# File lib/pact_broker/api/resources/provider_pacts.rb, line 36
def resource_title
  suffix = identifier_from_path[:tag] ? " with consumer version tag '#{identifier_from_path[:tag]}'" : ""
  "All pact versions for the provider #{identifier_from_path[:provider_name]}#{suffix}"
end