Class: QuickSearch::ItemPresenter

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

Overview

Presenter: item presenter.

Instance Method Summary collapse

Instance Method Details

#set_attributesObject



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

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



18
19
20
# File 'app/presenters/quick_search/item_presenter.rb', line 18

def text_sub_header
  result.name
end