Class: Company::Visit
- Defined in:
- lib/company/resources/visit.rb
Overview
Booked time: somebody is somewhere for an hour. Where it is, who is going and when are what a visit is for; the job or the lead it was booked against says why, and either may be absent.
Class Method Summary collapse
-
.attributes ⇒ Object
What every visit reads, by the vocabulary's names.
Instance Method Summary collapse
-
#anytime? ⇒ Boolean?
Whether the visit may happen any time that day rather than at an hour.
-
#description ⇒ String?
What the stop is, in the words of whoever booked it.
-
#ends_at ⇒ Time?
Moment the visit is booked to end.
-
#job ⇒ Job?
Job the stop belongs to, nil where no job was booked for it.
-
#lead ⇒ Lead?
Lead the stop belongs to, nil where no lead was booked for it.
-
#location ⇒ Location?
A stop says where it is without being asked what it was booked for, so a caller reading a schedule never has to reach through a job to find an address.
-
#starts_at ⇒ Time?
Moment the visit is booked to start.
-
#technicians ⇒ Array<Technician>
Whoever the stop is booked for, where the platform names them.
Methods inherited from Resource
#id, #initialize, keys, node_keys
Constructor Details
This class inherits a constructor from Company::Resource
Class Method Details
.attributes ⇒ Object
What every visit reads, by the vocabulary's names.
6 |
# File 'lib/company/resources/visit.rb', line 6 def self.attributes = %i[id description starts_at ends_at anytime] |
Instance Method Details
#anytime? ⇒ Boolean?
Returns whether the visit may happen any time that day rather than at an hour.
18 |
# File 'lib/company/resources/visit.rb', line 18 def anytime? = attribute :anytime |
#description ⇒ String?
Returns what the stop is, in the words of whoever booked it.
9 |
# File 'lib/company/resources/visit.rb', line 9 def description = attribute :description |
#ends_at ⇒ Time?
Returns moment the visit is booked to end.
15 |
# File 'lib/company/resources/visit.rb', line 15 def ends_at = time :ends_at |
#job ⇒ Job?
Returns job the stop belongs to, nil where no job was booked for it.
26 |
# File 'lib/company/resources/visit.rb', line 26 def job = record Job, :job |
#lead ⇒ Lead?
Returns lead the stop belongs to, nil where no lead was booked for it.
29 |
# File 'lib/company/resources/visit.rb', line 29 def lead = record Lead, :lead |
#location ⇒ Location?
A stop says where it is without being asked what it was booked for, so a caller reading a schedule never has to reach through a job to find an address.
23 |
# File 'lib/company/resources/visit.rb', line 23 def location = record Location, :location |
#starts_at ⇒ Time?
Returns moment the visit is booked to start.
12 |
# File 'lib/company/resources/visit.rb', line 12 def starts_at = time :starts_at |
#technicians ⇒ Array<Technician>
Returns whoever the stop is booked for, where the platform names them.
32 |
# File 'lib/company/resources/visit.rb', line 32 def technicians = records Technician, :technicians |