Class: Search::OpportunityTextPresenter

Inherits:
OpportunityPresenter
  • Object
show all
Defined in:
app/presenters/search/opportunity_text_presenter.rb

Overview

Plain-text presenter for opportunity search results backed by ViewOpportunity.

Instance Method Summary collapse

Instance Method Details

Returns the contact name as plain text, if available.

Returns:

  • (String, nil)


25
26
27
28
29
# File 'app/presenters/search/opportunity_text_presenter.rb', line 25

def contact_link
  return unless r.has_columns?(:contact_id, :contact_full_name)

  r.contact_full_name
end

Returns the customer name and number as plain text.

Returns:

  • (String, nil)


18
19
20
# File 'app/presenters/search/opportunity_text_presenter.rb', line 18

def customer_link
  "#{r.customer_full_name} (CN#{r.customer_id})"
end

Returns the opportunity name as plain text.

Returns:

  • (String)


11
12
13
# File 'app/presenters/search/opportunity_text_presenter.rb', line 11

def opportunity_link
  r.name
end