Class: Search::ServiceJobPresenter

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

Overview

Presenter: service job presenter.

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



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

def business_phone
  h.number_to_phone(r.business_phone)
end

#cell_phoneObject



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

def cell_phone
  h.number_to_phone(r.cell_phone)
end

#completed_onObject



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

def completed_on
  h.render_date(r.completed_on)
end


8
9
10
11
12
# File 'app/presenters/search/service_job_presenter.rb', line 8

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



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

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

#home_phoneObject



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

def home_phone
  h.number_to_phone(r.home_phone)
end

#job_dateObject



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

def job_date
  h.render_date(r.job_date)
end