Class: Company::Job

Inherits:
Resource show all
Defined in:
lib/company/resources/job.rb

Overview

Work the business accepted and scheduled.

Class Method Summary collapse

Instance Method Summary collapse

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 job reads, by the vocabulary's names.



5
# File 'lib/company/resources/job.rb', line 5

def self.attributes = i[id description notes created_at scheduled_at completed_at amount]

Instance Method Details

#amount ⇒ BigDecimal?

Returns what the job comes to, in dollars.

Returns:

  • (BigDecimal, nil) —

    what the job comes to, in dollars.



23
# File 'lib/company/resources/job.rb', line 23

def amount = decimal :amount

#completed_at ⇒ Time?

Returns moment the work was finished.

Returns:

  • (Time, nil) —

    moment the work was finished.



20
# File 'lib/company/resources/job.rb', line 20

def completed_at = time :completed_at

#created_at ⇒ Time

Returns moment the job was opened.

Returns:

  • (Time) —

    moment the job was opened.



14
# File 'lib/company/resources/job.rb', line 14

def created_at = time :created_at

#description ⇒ String?

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

Returns:

  • (String, nil) —

    what the work is called, in the words of whoever opened the job.



8
# File 'lib/company/resources/job.rb', line 8

def description = attribute :description

#lines ⇒ Array<Line>

Returns lines the work is billed as, empty where none came back.

Returns:

  • (Array<Line>) —

    lines the work is billed as, empty where none came back.



29
# File 'lib/company/resources/job.rb', line 29

def lines = records Line, :lines

#location ⇒ Location?

Returns where the work happens, where it came back beside the job.

Returns:

  • (Location, nil) —

    where the work happens, where it came back beside the job.



32
# File 'lib/company/resources/job.rb', line 32

def location = record Location, :location

#notes ⇒ String?

Returns what was written on the job for the crew to mind.

Returns:

  • (String, nil) —

    what was written on the job for the crew to mind.



11
# File 'lib/company/resources/job.rb', line 11

def notes = attribute :notes

#quote ⇒ Quote?

Returns quote the job was won with, where it came back beside the job.

Returns:

  • (Quote, nil) —

    quote the job was won with, where it came back beside the job.



26
# File 'lib/company/resources/job.rb', line 26

def quote = record Quote, :quote

#scheduled_at ⇒ Time?

Returns moment the work is booked for.

Returns:

  • (Time, nil) —

    moment the work is booked for.



17
# File 'lib/company/resources/job.rb', line 17

def scheduled_at = time :scheduled_at