Class: QuickSearch::CustomerPresenter

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

Overview

Presents a Customer as a quick search result / pinned item.

See Also:

Instance Method Summary collapse

Instance Method Details

#profile_image_urlString?

Returns the customer's 80x80 profile image URL, or nil.

Returns:

  • (String, nil)

    the customer's 80x80 profile image URL, or nil



16
17
18
19
20
# File 'app/presenters/quick_search/customer_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_attributesvoid

This method returns an undefined value.

Sets the card title and badge sub-header.



10
11
12
13
# File 'app/presenters/quick_search/customer_presenter.rb', line 10

def set_attributes
  @title = result.full_name
  @sub_header = build_sub_header
end