Class: QuickSearch::VariantGroupPresenter
- Inherits:
-
PinPresenter
- Object
- PinPresenter
- QuickSearch::VariantGroupPresenter
- Defined in:
- app/presenters/quick_search/variant_group_presenter.rb
Overview
Presents a VariantGroup (Amazon parent listing) as a quick search result /
pinned item.
Instance Method Summary collapse
-
#set_attributes ⇒ void
Sets the card title (SKU and marketplace), name/ASIN sub-header, link, and result class.
Instance Method Details
#set_attributes ⇒ void
This method returns an undefined value.
Sets the card title (SKU and marketplace), name/ASIN sub-header, link,
and result class.
12 13 14 15 16 17 18 19 |
# File 'app/presenters/quick_search/variant_group_presenter.rb', line 12 def set_attributes @title = "Parent Variation #{result.sku} (#{result.amazon_marketplace&.iso_code})#{' [Inactive]' if result.inactive}" @sub_header = h.tag.small(result.name) @sub_header << h.tag.br @sub_header << h.tag.small(result.asin, class: 'text-body-secondary') if result.asin.present? @link = variant_group_path(result) @result_class = :item end |