Class: Search::ServiceJobPresenter

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

Direct Known Subclasses

PresetJobPresenter

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

#business_phoneObject



23
24
25
# File 'app/presenters/search/service_job_presenter.rb', line 23

def business_phone
  h.number_to_phone(r.business_phone)
end

#cell_phoneObject



19
20
21
# File 'app/presenters/search/service_job_presenter.rb', line 19

def cell_phone
  h.number_to_phone(r.cell_phone)
end

#completed_onObject



31
32
33
# File 'app/presenters/search/service_job_presenter.rb', line 31

def completed_on
  h.render_date(r.completed_on)
end


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

def customer_link
  return unless r.has_columns?(:customer_full_name, :customer_id)
  h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end

#distanceObject



11
12
13
# File 'app/presenters/search/service_job_presenter.rb', line 11

def distance
  "#{r.distance.to_f.round(2)} mi."
end

#home_phoneObject



15
16
17
# File 'app/presenters/search/service_job_presenter.rb', line 15

def home_phone
  h.number_to_phone(r.home_phone)
end

#job_dateObject



27
28
29
# File 'app/presenters/search/service_job_presenter.rb', line 27

def job_date
  h.render_date(r.job_date)
end