Class: PactBroker::Api::Resources::LatestVerificationsForConsumerVersion

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb

Instance Method Summary collapse

Instance Method Details

#allowed_methodsObject



12
13
14
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 12

def allowed_methods
  ["GET", "OPTIONS"]
end

#content_types_providedObject



16
17
18
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 16

def content_types_provided
  [["application/hal+json", :to_json]]
end

#policy_nameObject



29
30
31
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 29

def policy_name
  :'verifications::verifications'
end

#policy_recordObject



33
34
35
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 33

def policy_record
  version
end

#resource_exists?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 20

def resource_exists?
  !!version
end

#to_jsonObject



24
25
26
27
# File 'lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb', line 24

def to_json
  summary = verification_service.verification_summary_for_consumer_version(identifier_from_path)
  decorator_for(summary).to_json(user_options: decorator_context(identifier_from_path))
end