Class: Search::ContactTextPresenter

Inherits:
ContactPresenter
  • Object
show all
Defined in:
app/presenters/search/contact_text_presenter.rb

Overview

Plain-text variant of ContactPresenter for CSV/Excel exports.

Instance Method Summary collapse

Instance Method Details

#contactString?

Contact full name (no link).

Returns:

  • (String, nil)


8
9
10
11
12
# File 'app/presenters/search/contact_text_presenter.rb', line 8

def contact
  return unless r.has_columns?(:id, :full_name)

  r.full_name
end

#customerString?

Customer name with account number (no link).

Returns:

  • (String, nil)


17
18
19
20
21
# File 'app/presenters/search/contact_text_presenter.rb', line 17

def customer
  return unless r.has_columns?(:customer_id, :customer_full_name)

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