Class: Search::RmaTextPresenter
- Inherits:
-
RmaPresenter
- Object
- RmaPresenter
- Search::RmaTextPresenter
- Defined in:
- app/presenters/search/rma_text_presenter.rb
Overview
Text-only variant of RmaPresenter for RMA search results.
Instance Method Summary collapse
-
#customer_link ⇒ String?
Returns the customer name and account number as plain text.
-
#order_link ⇒ String?
Returns the original order reference number as plain text.
-
#returned_reasons ⇒ String
Returns the returned reasons joined by semicolons.
-
#rma_link ⇒ String
Returns the RMA number as plain text.
Instance Method Details
#customer_link ⇒ String?
Returns the customer name and account number as plain text.
17 18 19 20 21 |
# File 'app/presenters/search/rma_text_presenter.rb', line 17 def customer_link return unless r.has_columns?(:customer_full_name, :customer_id) "#{r.customer_full_name} (CN#{r.customer_id})" end |
#order_link ⇒ String?
Returns the original order reference number as plain text.
26 27 28 29 30 |
# File 'app/presenters/search/rma_text_presenter.rb', line 26 def order_link return unless r.has_columns?(:original_order_reference_number, :original_order_id) r.original_order_reference_number end |
#returned_reasons ⇒ String
Returns the returned reasons joined by semicolons.
35 36 37 |
# File 'app/presenters/search/rma_text_presenter.rb', line 35 def returned_reasons RmaReasonCode.where(code: r.returned_reasons).order(:code).map { |rrc| "#{rrc.code} - #{rrc.description}" }.join(';') end |
#rma_link ⇒ String
Returns the RMA number as plain text.
10 11 12 |
# File 'app/presenters/search/rma_text_presenter.rb', line 10 def rma_link r.rma_number end |