Class: Customer::DetailedLookupPresenter

Inherits:
Object
  • Object
show all
Includes:
Spree::BaseHelper
Defined in:
app/presenters/customer/detailed_lookup_presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource:) ⇒ DetailedLookupPresenter

Returns a new instance of DetailedLookupPresenter.



8
9
10
# File 'app/presenters/customer/detailed_lookup_presenter.rb', line 8

def initialize(resource:)
  @resource = resource
end

Instance Method Details

#to_hObject



12
13
14
15
16
# File 'app/presenters/customer/detailed_lookup_presenter.rb', line 12

def to_h
  return [] unless resource.customer.present?

  resource.guest ? guest_presenter : registered_presenter
end