Class: Jbr::Job

Inherits:
Resource show all
Includes:
Cliental, Properted
Defined in:
lib/jbr/job.rb

Overview

Work a Jobber user accepted and scheduled.

Direct Known Subclasses

Mock::Job

Constant Summary

Constants included from Cliental

Cliental::FIELDS, Cliental::SELECTION

Instance Attribute Summary

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods included from Cliental

#client

Methods included from Properted

#property, selection

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#completed_atTime?

Returns the job completed time.

Returns:

  • (Time, nil)

    the job completed time



35
# File 'lib/jbr/job.rb', line 35

def completed_at = time 'completedAt'

#created_atTime?

Returns the job opening time.

Returns:

  • (Time, nil)

    the job opening time



29
# File 'lib/jbr/job.rb', line 29

def created_at = time 'createdAt'

#instructionsString?

Returns what the work is, in the words whoever opened the job wrote.

Returns:

  • (String, nil)

    what the work is, in the words whoever opened the job wrote.



14
# File 'lib/jbr/job.rb', line 14

def instructions = @node['instructions']

#nameString

A job goes untitled often enough, and something has to stand in for it on a list.

Returns:

  • (String)

    the title, or the ID Jobber files the job under.



11
# File 'lib/jbr/job.rb', line 11

def name = title || id

#quote_idString?

Returns the ID of the quote the job was won with.

Returns:

  • (String, nil)

    the ID of the quote the job was won with.



20
# File 'lib/jbr/job.rb', line 20

def quote_id = @node.dig 'quote', 'id'

#quote_totalFloat?

Returns what the quote the job was won with came to.

Returns:

  • (Float, nil)

    what the quote the job was won with came to.



26
# File 'lib/jbr/job.rb', line 26

def quote_total = @node.dig 'quote', 'amounts', 'total'

#scheduled_atTime?

Returns the job scheduled time.

Returns:

  • (Time, nil)

    the job scheduled time



32
# File 'lib/jbr/job.rb', line 32

def scheduled_at = time 'startAt'

#statusString?

Returns where Jobber files the job in its own workflow.

Returns:

  • (String, nil)

    where Jobber files the job in its own workflow.



17
# File 'lib/jbr/job.rb', line 17

def status = @node['jobStatus']

#titleString?

Returns what the job is called, where whoever opened it named it.

Returns:

  • (String, nil)

    what the job is called, where whoever opened it named it.



7
# File 'lib/jbr/job.rb', line 7

def title = @node['title']

#totalFloat?

Returns what the job comes to.

Returns:

  • (Float, nil)

    what the job comes to.



23
# File 'lib/jbr/job.rb', line 23

def total = @node['total']