Class: PactBroker::Api::Resources::Version
- Inherits:
-
BaseResource
- Object
- BaseResource
- PactBroker::Api::Resources::Version
- Defined in:
- lib/pact_broker/api/resources/version.rb
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
- #delete_resource ⇒ Object
- #resource_exists? ⇒ Boolean
- #resource_object ⇒ Object
- #to_json ⇒ Object
Instance Method Details
#allowed_methods ⇒ Object
14 15 16 |
# File 'lib/pact_broker/api/resources/version.rb', line 14 def allowed_methods ["GET", "DELETE", "OPTIONS"] end |
#content_types_provided ⇒ Object
10 11 12 |
# File 'lib/pact_broker/api/resources/version.rb', line 10 def content_types_provided [["application/hal+json", :to_json]] end |
#delete_resource ⇒ Object
30 31 32 33 |
# File 'lib/pact_broker/api/resources/version.rb', line 30 def delete_resource version_service.delete version true end |
#resource_exists? ⇒ Boolean
18 19 20 |
# File 'lib/pact_broker/api/resources/version.rb', line 18 def resource_exists? !!resource_object end |
#resource_object ⇒ Object
22 23 24 |
# File 'lib/pact_broker/api/resources/version.rb', line 22 def resource_object version end |
#to_json ⇒ Object
26 27 28 |
# File 'lib/pact_broker/api/resources/version.rb', line 26 def to_json Decorators::VersionDecorator.new(version).to_json(user_options: {base_url: base_url}) end |