Class: Search::ContactPresenter
- Inherits:
-
BasePresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/contact_presenter.rb
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u
Constructor Details
This class inherits a constructor from BasePresenter
Instance Method Details
6
7
8
9
|
# File 'app/presenters/search/contact_presenter.rb', line 6
def contact
return unless r.has_columns?(:id, :full_name) && r.id && r.full_name
h.link_to r.full_name, h.contact_path(r.id)
end
|
16
17
18
19
|
# File 'app/presenters/search/contact_presenter.rb', line 16
def contact_roles
return unless r.has_columns?(:contact_roles) && r.contact_roles.present?
(r.contact_roles || []).map(&:presence).compact.map(&:titleize).try(:to_sentence)
end
|
#customer ⇒ Object
11
12
13
14
|
# File 'app/presenters/search/contact_presenter.rb', line 11
def customer
return unless r.has_columns?(:customer_id, :customer_full_name) && r.customer_id && r.customer_full_name
h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end
|
#primary_fax ⇒ Object
26
27
28
29
|
# File 'app/presenters/search/contact_presenter.rb', line 26
def primary_fax
return unless r.has_columns?(:primary_fax) && r.primary_fax.present?
h.number_to_phone(r.primary_fax)
end
|
#primary_fax_international ⇒ Object
36
37
38
39
|
# File 'app/presenters/search/contact_presenter.rb', line 36
def primary_fax_international
return unless r.has_columns?(:primary_fax) && r.primary_fax.present?
r.primary_fax
end
|
#primary_phone ⇒ Object
21
22
23
24
|
# File 'app/presenters/search/contact_presenter.rb', line 21
def primary_phone
return unless r.has_columns?(:primary_phone) && r.primary_phone.present?
h.number_to_phone(r.primary_phone)
end
|
#primary_phone_international ⇒ Object
31
32
33
34
|
# File 'app/presenters/search/contact_presenter.rb', line 31
def primary_phone_international
return unless r.has_columns?(:primary_phone) && r.primary_phone.present?
r.primary_phone
end
|