Class: Jbr::Job
- Defined in:
- lib/jbr/job.rb
Overview
Work a Jobber user accepted and scheduled.
Direct Known Subclasses
Constant Summary
Constants included from Cliental
Cliental::FIELDS, Cliental::SELECTION
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#completed_at ⇒ Time?
The job completed time.
-
#created_at ⇒ Time?
The job opening time.
-
#instructions ⇒ String?
What the work is, in the words whoever opened the job wrote.
-
#quote_id ⇒ String?
The ID of the quote the job was won with.
-
#quote_total ⇒ Float?
What the quote the job was won with came to.
-
#scheduled_at ⇒ Time?
The job scheduled time.
-
#status ⇒ String?
Where Jobber files the job in its own workflow.
-
#summary ⇒ String
What the job's lines add up to, each as how many of what:
3 Faucet install and 2 Valve change. -
#title ⇒ String?
What the job is called, where whoever opened it named it.
-
#total ⇒ Float?
What the job comes to.
Methods included from Cliental
Methods included from Itemized
Methods included from Named
Methods included from Properted
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Jbr::Resource
Instance Method Details
#completed_at ⇒ Time?
Returns the job completed time.
38 |
# File 'lib/jbr/job.rb', line 38 def completed_at = time 'completedAt' |
#created_at ⇒ Time?
Returns the job opening time.
32 |
# File 'lib/jbr/job.rb', line 32 def created_at = time 'createdAt' |
#instructions ⇒ String?
Returns what the work is, in the words whoever opened the job wrote.
10 |
# File 'lib/jbr/job.rb', line 10 def instructions = @node['instructions'] |
#quote_id ⇒ String?
Returns the ID of the quote the job was won with.
23 |
# File 'lib/jbr/job.rb', line 23 def quote_id = @node.dig 'quote', 'id' |
#quote_total ⇒ Float?
Returns what the quote the job was won with came to.
29 |
# File 'lib/jbr/job.rb', line 29 def quote_total = @node.dig 'quote', 'amounts', 'total' |
#scheduled_at ⇒ Time?
Returns the job scheduled time.
35 |
# File 'lib/jbr/job.rb', line 35 def scheduled_at = time 'startAt' |
#status ⇒ String?
Returns where Jobber files the job in its own workflow.
20 |
# File 'lib/jbr/job.rb', line 20 def status = @node['jobStatus'] |
#summary ⇒ String
What the job's lines add up to, each as how many of what: 3 Faucet install and 2 Valve change. The lines say what the work was where a title only says what it was called, so
this reads better than one — and falls back to Named#name where the job has no lines, or
where the query never asked for them. Never nil and never empty.
17 |
# File 'lib/jbr/job.rb', line 17 def summary = line_items.map(&:quantified).to_sentence.presence || name |
#title ⇒ String?
Returns what the job is called, where whoever opened it named it.
7 |
# File 'lib/jbr/job.rb', line 7 def title = @node['title'] |
#total ⇒ Float?
Returns what the job comes to.
26 |
# File 'lib/jbr/job.rb', line 26 def total = @node['total'] |