Class: PactBroker::Api::Resources::Versions
- Inherits:
-
BaseResource
- Object
- BaseResource
- PactBroker::Api::Resources::Versions
- Defined in:
- lib/pact_broker/api/resources/versions.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
- #policy_name ⇒ Object
- #resource_exists? ⇒ Boolean
- #to_json ⇒ Object
- #versions ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
13 14 15 |
# File 'lib/pact_broker/api/resources/versions.rb', line 13 def allowed_methods ["GET", "OPTIONS"] end |
#content_types_provided ⇒ Object
9 10 11 |
# File 'lib/pact_broker/api/resources/versions.rb', line 9 def content_types_provided [["application/hal+json", :to_json]] end |
#policy_name ⇒ Object
29 30 31 |
# File 'lib/pact_broker/api/resources/versions.rb', line 29 def policy_name :'versions::versions' end |
#resource_exists? ⇒ Boolean
17 18 19 |
# File 'lib/pact_broker/api/resources/versions.rb', line 17 def resource_exists? !!pacticipant end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/pact_broker/api/resources/versions.rb', line 21 def to_json PactBroker::Api::Decorators::VersionsDecorator.new(versions).to_json(user_options: decorator_context(identifier_from_path)) end |
#versions ⇒ Object
25 26 27 |
# File 'lib/pact_broker/api/resources/versions.rb', line 25 def versions @versions ||= pacticipant_service.find_all_pacticipant_versions_in_reverse_order pacticipant_name end |