Class: PactBroker::Api::Resources::PreviousDistinctPactVersion
- Inherits:
-
BaseResource
- Object
- PactBroker::Api::Resources::PreviousDistinctPactVersion
- Defined in:
- lib/pact_broker/api/resources/previous_distinct_pact_version.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
- #pact ⇒ Object
- #pact_params ⇒ Object
- #policy_resource ⇒ Object
- #resource_exists? ⇒ Boolean
- #resource_object ⇒ Object
- #to_json ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
15 16 17 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 15 def allowed_methods ["GET", "OPTIONS"] end |
#content_types_provided ⇒ Object
11 12 13 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 11 def content_types_provided [["application/hal+json", :to_json]] end |
#pact ⇒ Object
35 36 37 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 35 def pact @pact ||= pact_service.find_previous_distinct_pact_version(pact_params) end |
#pact_params ⇒ Object
39 40 41 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 39 def pact_params @pact_params ||= PactBroker::Pacts::PactParams.from_request request, path_info end |
#policy_resource ⇒ Object
27 28 29 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 27 def policy_resource pact end |
#resource_exists? ⇒ Boolean
19 20 21 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 19 def resource_exists? !!resource_object end |
#resource_object ⇒ Object
23 24 25 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 23 def resource_object pact end |
#to_json ⇒ Object
31 32 33 |
# File 'lib/pact_broker/api/resources/previous_distinct_pact_version.rb', line 31 def to_json PactBroker::Api::Decorators::PactDecorator.new(pact).to_json(user_options: {base_url: base_url}) end |