Class: Search::SupplierItemTextPresenter

Inherits:
SupplierItemPresenter
  • Object
show all
Defined in:
app/presenters/search/supplier_item_text_presenter.rb

Overview

Text-only variant of SupplierItemPresenter.

Instance Method Summary collapse

Instance Method Details

#activeString

Returns a "Yes"/"No" label for the active flag.

Returns:

  • (String)

    "Yes" or "No"



19
20
21
# File 'app/presenters/search/supplier_item_text_presenter.rb', line 19

def active
  h.y r.active
end

Returns the supplier item SKU as plain text, if available.

Returns:

  • (String, nil)

    the SKU, or nil



10
11
12
13
14
# File 'app/presenters/search/supplier_item_text_presenter.rb', line 10

def item_link
  return unless r.has_columns?(:sku, :item_id)

  r.sku
end