Class: PactBroker::UI::ViewDomain::MatrixTag
- Inherits:
-
Object
- Object
- PactBroker::UI::ViewDomain::MatrixTag
show all
- Includes:
- Api::PactBrokerUrls
- Defined in:
- lib/pact_broker/ui/view_models/matrix_tag.rb
Instance Method Summary
collapse
#badge_url_for_latest_pact, #consumer_webhooks_url, #hal_browser_url, #label_url, #labels_url, #latest_pact_url, #latest_pacts_url, #latest_untagged_pact_url, #latest_verifications_for_consumer_version_url, #latest_version_url, #matrix_url_from_params, #new_verification_url, #pact_triggered_webhooks_url, #pact_url, #pact_url_from_params, #pact_version_url, #pact_versions_url, #pacticipant_url, #pacticipant_url_from_params, #pacticipants_url, #previous_distinct_diff_url, #previous_distinct_pact_version_url, #provider_webhooks_url, #tag_url, #tags_url, #templated_diff_url, #templated_label_url_for_pacticipant, #templated_tag_url_for_pacticipant, #triggered_webhook_logs_url, #url_encode, #verification_publication_url, #verification_triggered_webhooks_url, #verification_url, #verification_url_from_params, #version_url, #version_url_from_params, #versions_url, #webhook_execution_url, #webhook_url, #webhooks_for_consumer_and_provider_url, #webhooks_for_pact_url, #webhooks_status_url, #webhooks_url
Constructor Details
#initialize(params) ⇒ MatrixTag
Returns a new instance of MatrixTag.
12
13
14
15
16
17
18
|
# File 'lib/pact_broker/ui/view_models/matrix_tag.rb', line 12
def initialize params
@params = params
@name = params[:name]
@version_number = params[:version_number]
@created_at = params[:created_at]
@latest = !!params[:latest]
end
|
Instance Method Details
#name ⇒ Object
20
21
22
|
# File 'lib/pact_broker/ui/view_models/matrix_tag.rb', line 20
def name
@params[:name]
end
|
#relative_date(date) ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/pact_broker/ui/view_models/matrix_tag.rb', line 24
def tooltip
if @latest
"Version #{@version_number} is the latest version with tag #{@name}. Tag created #{relative_date(@created_at)}."
else
"Tag created #{relative_date(@created_at)}."
end
end
|
#url ⇒ Object
32
33
34
|
# File 'lib/pact_broker/ui/view_models/matrix_tag.rb', line 32
def url
hal_browser_url("/pacticipants/#{ERB::Util.url_encode(@params[:pacticipant_name])}/versions/#{@params[:version_number]}/tags/#{@params[:name]}")
end
|