Class: Search::CustomerTextPresenter

Inherits:
CustomerPresenter
  • Object
show all
Defined in:
app/presenters/search/customer_text_presenter.rb

Overview

Plain-text variant of CustomerPresenter for exports and
other non-HTML renderings.

Delegated Instance Attributes collapse

Instance Method Summary collapse

Instance Method Details

#customerString

Customer full name with customer number.

Returns:

  • (String)


9
10
11
# File 'app/presenters/search/customer_text_presenter.rb', line 9

def customer
  "#{r.full_name} (CN#{r.id})"
end

#customer_watch_symbolActiveSupport::SafeBuffer?

Plain-text watch indicator, or nil when the search row does not
include the required columns.

Returns:

  • (ActiveSupport::SafeBuffer, nil)


24
25
26
27
28
# File 'app/presenters/search/customer_text_presenter.rb', line 24

def customer_watch_symbol
  return unless r.has_columns?(:watch, :open_sales_activity)

  h.y r.customer_watch
end

#drop_reasonsString

Drop reasons joined by spaces.

Returns:

  • (String)


52
53
54
# File 'app/presenters/search/customer_text_presenter.rb', line 52

def drop_reasons
  r.drop_reasons.join(' ')
end

#has_online_accountActiveSupport::SafeBuffer

Y / blank indicator for online account status.

Returns:

  • (ActiveSupport::SafeBuffer)


40
41
42
# File 'app/presenters/search/customer_text_presenter.rb', line 40

def 
  h.y r.
end

#idString

Customer number (CN<id>) as plain text.

Returns:

  • (String)


16
17
18
# File 'app/presenters/search/customer_text_presenter.rb', line 16

def id
  "CN#{r.id}"
end

#open_sales_activityActiveSupport::SafeBuffer

Y / blank indicator for open sales activity.

Returns:

  • (ActiveSupport::SafeBuffer)


33
34
35
# File 'app/presenters/search/customer_text_presenter.rb', line 33

def open_sales_activity
  h.y r.open_sales_activity
end

#ratingObject

Alias for R#rating

Returns:

  • (Object)

    R#rating

See Also:



47
# File 'app/presenters/search/customer_text_presenter.rb', line 47

delegate :rating, to: :r