Class: Search::DeliveryPresenter
- Inherits:
-
BasePresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/delivery_presenter.rb
Overview
Presenter: delivery presenter.
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u
Constructor Details
This class inherits a constructor from BasePresenter
Instance Method Details
#created_at ⇒ Object
28
29
30
|
# File 'app/presenters/search/delivery_presenter.rb', line 28
def created_at
h.render_datetime r.created_at
end
|
#customer_link ⇒ Object
16
17
18
|
# File 'app/presenters/search/delivery_presenter.rb', line 16
def customer_link
h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end
|
#delivery_link ⇒ Object
8
9
10
|
# File 'app/presenters/search/delivery_presenter.rb', line 8
def delivery_link
h.link_to "DE#{r.id}", h.delivery_path(r.id)
end
|
#line_total ⇒ Object
20
21
22
|
# File 'app/presenters/search/delivery_presenter.rb', line 20
def line_total
h.number_to_currency(r.line_total || 0.0, unit: r.currency_symbol)
end
|
#order_link ⇒ Object
12
13
14
|
# File 'app/presenters/search/delivery_presenter.rb', line 12
def order_link
h.link_to r.order_reference_number, h.order_path(r.order_id)
end
|
#shipped_date ⇒ Object
24
25
26
|
# File 'app/presenters/search/delivery_presenter.rb', line 24
def shipped_date
h.render_datetime(r.shipped_date)
end
|
#state ⇒ Object
36
37
38
|
# File 'app/presenters/search/delivery_presenter.rb', line 36
def state
Delivery.human_state_name(r.state)
end
|
#updated_at ⇒ Object
32
33
34
|
# File 'app/presenters/search/delivery_presenter.rb', line 32
def updated_at
h.render_datetime r.updated_at
end
|