Class: PactBroker::Api::Resources::Tag
Constant Summary
Constants included
from Logging
Logging::LOG_DIR, Logging::LOG_FILE_NAME
Instance Method Summary
collapse
#base_url, #charsets_provided, #consumer_name, #contract_validation_errors?, #decorator_context, #encode, #handle_exception, #identifier_from_path, #invalid_json?, #params, #provider_name, #request_body, #resource_url, #set_json_error_message, #set_json_validation_error_messages, #validation_errors?
Methods included from Logging
included, #logger, #logger=
#hal_browser_url, #latest_pact_url, #latest_pacts_url, #latest_version_url, #pact_url, #pact_url_from_params, #pact_versions_url, #pacticipant_url, #pacticipants_url, #previous_distinct_diff_url, #previous_distinct_pact_version_url, #tag_url, #tags_url, #url_encode, #version_url, #versions_url, #webhook_execution_url, #webhook_url, #webhooks_for_pact_url, #webhooks_url
Methods included from Services
#group_service, #pact_service, #pacticipant_service, #tag_service, #version_service, #webhook_service
Instance Method Details
#allowed_methods ⇒ Object
17
18
19
|
# File 'lib/pact_broker/api/resources/tag.rb', line 17
def allowed_methods
["GET","PUT","DELETE"]
end
|
#content_types_accepted ⇒ Object
13
14
15
|
# File 'lib/pact_broker/api/resources/tag.rb', line 13
def content_types_accepted
[["application/json", :from_json]]
end
|
#content_types_provided ⇒ Object
9
10
11
|
# File 'lib/pact_broker/api/resources/tag.rb', line 9
def content_types_provided
[["application/hal+json", :to_json]]
end
|
#delete_resource ⇒ Object
42
43
44
45
|
# File 'lib/pact_broker/api/resources/tag.rb', line 42
def delete_resource
tag_service.delete identifier_from_path
true
end
|
#from_json ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/pact_broker/api/resources/tag.rb', line 21
def from_json
unless tag
@tag = tag_service.create identifier_from_path
response.["Location"] = tag_url(base_url, tag)
end
response.body = to_json
end
|
#resource_exists? ⇒ Boolean
30
31
32
|
# File 'lib/pact_broker/api/resources/tag.rb', line 30
def resource_exists?
tag
end
|
#tag ⇒ Object
38
39
40
|
# File 'lib/pact_broker/api/resources/tag.rb', line 38
def tag
@tag ||= tag_service.find identifier_from_path
end
|