Class: QuickSearch::ItemPresenter

Inherits:
PinPresenter
  • Object
show all
Defined in:
app/presenters/quick_search/item_presenter.rb

Instance Method Summary collapse

Instance Method Details

#set_attributesObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/presenters/quick_search/item_presenter.rb', line 2

def set_attributes
  @title = result.sku
  @sub_header = +''
  @sub_header << item_state_badge
  @sub_header << h.tag.span(result.amazon_asin, class: 'badge bg-info') if result.amazon_asin.present?
  if result.is_publication?
    @link = publication_path(result)
    @result_class = :publication
  else
    @link = item_path(result)
    @result_class = :item
  end
end

#text_sub_headerObject



16
17
18
# File 'app/presenters/quick_search/item_presenter.rb', line 16

def text_sub_header
  result.name
end