Class: Search::DeliveryPresenter

Inherits:
BasePresenter show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/delivery_presenter.rb

Direct Known Subclasses

DeliveryTextPresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

Methods inherited from BasePresenter

#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_atObject



26
27
28
# File 'app/presenters/search/delivery_presenter.rb', line 26

def created_at
  h.render_datetime r.created_at
end


14
15
16
# File 'app/presenters/search/delivery_presenter.rb', line 14

def customer_link
  h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end


6
7
8
# File 'app/presenters/search/delivery_presenter.rb', line 6

def delivery_link
  h.link_to "DE#{r.id}", h.delivery_path(r.id)
end

#line_totalObject



18
19
20
# File 'app/presenters/search/delivery_presenter.rb', line 18

def line_total
  h.number_to_currency(r.line_total || 0.0, unit: r.currency_symbol)
end


10
11
12
# File 'app/presenters/search/delivery_presenter.rb', line 10

def order_link
  h.link_to r.order_reference_number, h.order_path(r.order_id)
end

#shipped_dateObject



22
23
24
# File 'app/presenters/search/delivery_presenter.rb', line 22

def shipped_date
  h.render_datetime(r.shipped_date)
end

#stateObject



34
35
36
# File 'app/presenters/search/delivery_presenter.rb', line 34

def state
  Delivery.human_state_name(r.state)
end

#updated_atObject



30
31
32
# File 'app/presenters/search/delivery_presenter.rb', line 30

def updated_at
  h.render_datetime r.updated_at
end