Class: PactBroker::Api::Resources::MatrixForConsumerAndProvider
- Inherits:
-
BaseResource
- Object
- PactBroker::Api::Resources::MatrixForConsumerAndProvider
- Defined in:
- lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
-
#initialize ⇒ MatrixForConsumerAndProvider
constructor
A new instance of MatrixForConsumerAndProvider.
- #resource_exists? ⇒ Boolean
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ MatrixForConsumerAndProvider
Returns a new instance of MatrixForConsumerAndProvider.
9 10 11 12 |
# File 'lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb', line 9 def initialize super _, @options = PactBroker::Matrix::ParseQuery.call(request.uri.query) end |
Instance Method Details
#allowed_methods ⇒ Object
18 19 20 |
# File 'lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb', line 18 def allowed_methods ["GET", "OPTIONS"] end |
#content_types_provided ⇒ Object
14 15 16 |
# File 'lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb', line 14 def content_types_provided [["application/hal+json", :to_json]] end |
#resource_exists? ⇒ Boolean
22 23 24 |
# File 'lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb', line 22 def resource_exists? consumer && provider end |
#to_json ⇒ Object
26 27 28 |
# File 'lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb', line 26 def to_json PactBroker::Api::Decorators::MatrixDecorator.new(results).to_json() end |