Class: PactBroker::Api::Resources::TaggedPactVersions
- Inherits:
-
BaseResource
- Object
- PactBroker::Api::Resources::TaggedPactVersions
- Defined in:
- lib/pact_broker/api/resources/tagged_pact_versions.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
- #delete_resource ⇒ Object
- #pacts ⇒ Object
- #resource_exists? ⇒ Boolean
- #to_json ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
14 15 16 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 14 def allowed_methods ["GET", "DELETE", "OPTIONS"] end |
#content_types_provided ⇒ Object
10 11 12 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 10 def content_types_provided [["application/hal+json", :to_json]] end |
#delete_resource ⇒ Object
26 27 28 29 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 26 def delete_resource pact_service.delete_all_pact_publications_between consumer_name, and: provider_name, tag: identifier_from_path[:tag] true end |
#pacts ⇒ Object
31 32 33 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 31 def pacts pact_service.find_all_pact_versions_between consumer_name, and: provider_name, tag: identifier_from_path[:tag] end |
#resource_exists? ⇒ Boolean
18 19 20 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 18 def resource_exists? consumer && provider end |
#to_json ⇒ Object
22 23 24 |
# File 'lib/pact_broker/api/resources/tagged_pact_versions.rb', line 22 def to_json PactBroker::Api::Decorators::TaggedPactVersionsDecorator.new(pacts).to_json(user_options: decorator_context(identifier_from_path)) end |