Class: Customer::BasicLookupPresenter
- Inherits:
-
Object
- Object
- Customer::BasicLookupPresenter
- Defined in:
- app/presenters/customer/basic_lookup_presenter.rb
Instance Method Summary collapse
-
#initialize(resource:) ⇒ BasicLookupPresenter
constructor
A new instance of BasicLookupPresenter.
- #to_h ⇒ Object
Constructor Details
#initialize(resource:) ⇒ BasicLookupPresenter
Returns a new instance of BasicLookupPresenter.
5 6 7 8 9 |
# File 'app/presenters/customer/basic_lookup_presenter.rb', line 5 def initialize(resource:) @resource = resource @registered_customers = resource.registered_customers @guest_customers = resource.guest_customers end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 |
# File 'app/presenters/customer/basic_lookup_presenter.rb', line 11 def to_h return [] if guest_customers.empty? && registered_customers.empty? registered_presenter.concat(guest_presenter) end |