Class: QuickSearch::SupplierPresenter
- Inherits:
-
PinPresenter
- Object
- PinPresenter
- QuickSearch::SupplierPresenter
- Defined in:
- app/presenters/quick_search/supplier_presenter.rb
Overview
Presents a Supplier as a quick search result / pinned item.
Instance Method Summary collapse
-
#profile_image_url ⇒ String?
The supplier's 80x80 profile image URL, or nil.
-
#set_attributes ⇒ void
Sets the card title (supplier name) and location sub-header.
Instance Method Details
#profile_image_url ⇒ String?
Returns the supplier's 80x80 profile image URL, or nil.
16 17 18 19 20 |
# File 'app/presenters/quick_search/supplier_presenter.rb', line 16 def profile_image_url return if result.profile_image.blank? result.profile_image.image_url(width: 80, height: 80) end |
#set_attributes ⇒ void
This method returns an undefined value.
Sets the card title (supplier name) and location sub-header.
10 11 12 13 |
# File 'app/presenters/quick_search/supplier_presenter.rb', line 10 def set_attributes @title = result.full_name @sub_header = result.location_name end |