Class: Company::Visits
- Inherits:
-
Collection
- Object
- Collection
- Company::Visits
- Defined in:
- lib/company/collections/visits.rb
Overview
The visits of a business: every stop somebody is booked for, of a job or of a lead where
the work is still being looked at. A gem answers create where its platform books a stop
against a lead, and for_jobs or for_leads where it can ask its platform for one kind
alone; where it cannot, the list is walked and the other kind let go.
Instance Method Summary collapse
-
#create(name:, surname:, phone:, email:, address:, description:, notes:, source:, starts_at:, ends_at:, technicians:) ⇒ Visit
Books a stop to look at work nobody has priced yet, opening the customer and whatever the platform hangs the stop off wherever it has none.
-
#for_jobs ⇒ Collection
The same list, narrowed to the stops of jobs.
-
#for_leads ⇒ Collection
The same list, narrowed to the stops of leads.
-
#for_work ⇒ Collection
Booked time a platform can say something about: the stops of jobs and of leads together, without the hours blocked out around them, which name no work and cost a list of their own on a platform that files them apart.
Methods inherited from Collection
#ids, #includes, #of, #past, #upcoming
Instance Method Details
#create(name:, surname:, phone:, email:, address:, description:, notes:, source:, starts_at:, ends_at:, technicians:) ⇒ Visit
Books a stop to look at work nobody has priced yet, opening the customer and whatever the platform hangs the stop off wherever it has none.
21 22 23 24 |
# File 'lib/company/collections/visits.rb', line 21 def create(name:, surname:, phone:, email:, address:, description:, notes:, source:, starts_at:, ends_at:, technicians:) raise NotImplementedError, "#{self.class} does not book a visit" end |
#for_jobs ⇒ Collection
Returns the same list, narrowed to the stops of jobs.
27 |
# File 'lib/company/collections/visits.rb', line 27 def for_jobs = Selection.new(collection: self, &:job) |
#for_leads ⇒ Collection
Returns the same list, narrowed to the stops of leads.
30 |
# File 'lib/company/collections/visits.rb', line 30 def for_leads = Selection.new(collection: self, &:lead) |
#for_work ⇒ Collection
Booked time a platform can say something about: the stops of jobs and of leads together, without the hours blocked out around them, which name no work and cost a list of their own on a platform that files them apart.
36 |
# File 'lib/company/collections/visits.rb', line 36 def for_work = Selection.new(collection: self) { |visit| visit.job || visit.lead } |