Class: Search::CustomerTextPresenter
- Inherits:
-
CustomerPresenter
- Object
- CustomerPresenter
- Search::CustomerTextPresenter
- 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
-
#rating ⇒ Object
Alias for R#rating.
Instance Method Summary collapse
-
#customer ⇒ String
Customer full name with customer number.
-
#customer_watch_symbol ⇒ ActiveSupport::SafeBuffer?
Plain-text watch indicator, or nil when the search row does not include the required columns.
-
#drop_reasons ⇒ String
Drop reasons joined by spaces.
-
#has_online_account ⇒ ActiveSupport::SafeBuffer
Y/ blank indicator for online account status. -
#id ⇒ String
Customer number (
CN<id>) as plain text. -
#open_sales_activity ⇒ ActiveSupport::SafeBuffer
Y/ blank indicator for open sales activity.
Instance Method Details
#customer ⇒ String
Customer full name with customer number.
9 10 11 |
# File 'app/presenters/search/customer_text_presenter.rb', line 9 def customer "#{r.full_name} (CN#{r.id})" end |
#customer_watch_symbol ⇒ ActiveSupport::SafeBuffer?
Plain-text watch indicator, or nil when the search row does not
include the required columns.
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_reasons ⇒ String
Drop reasons joined by spaces.
52 53 54 |
# File 'app/presenters/search/customer_text_presenter.rb', line 52 def drop_reasons r.drop_reasons.join(' ') end |
#has_online_account ⇒ ActiveSupport::SafeBuffer
Y / blank indicator for online account status.
40 41 42 |
# File 'app/presenters/search/customer_text_presenter.rb', line 40 def has_online_account h.y r.has_online_account end |
#id ⇒ String
Customer number (CN<id>) as plain text.
16 17 18 |
# File 'app/presenters/search/customer_text_presenter.rb', line 16 def id "CN#{r.id}" end |
#open_sales_activity ⇒ ActiveSupport::SafeBuffer
Y / blank indicator for open sales activity.
33 34 35 |
# File 'app/presenters/search/customer_text_presenter.rb', line 33 def open_sales_activity h.y r.open_sales_activity end |
#rating ⇒ Object
Alias for R#rating
47 |
# File 'app/presenters/search/customer_text_presenter.rb', line 47 delegate :rating, to: :r |