Class: Jbr::Mock::Invoice

Inherits:
Invoice show all
Defined in:
lib/jbr/mock/invoice.rb

Overview

An invoice that reads from Jbr.mock instead of Jobber.

Constant Summary

Constants inherited from Invoice

Invoice::FIND

Instance Attribute Summary

Attributes inherited from Invoice

#job_id, #total

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#completed_atObject



16
# File 'lib/jbr/mock/invoice.rb', line 16

def completed_at = Jbr.mock.invoice[:completed_at]

#find(_) ⇒ Mock::Invoice

Returns itself, carrying the mocked IDs and total.

Returns:



5
6
7
8
9
10
11
# File 'lib/jbr/mock/invoice.rb', line 5

def find(_)
  @id = Jbr.mock.invoice[:id]
  @job_id = Jbr.mock.invoice[:job_id]
  @total = Jbr.mock.invoice[:total]

  self
end

#issued_atTime?

Returns the dates the app asked for.

Returns:

  • (Time, nil)

    the dates the app asked for.



14
# File 'lib/jbr/mock/invoice.rb', line 14

def issued_at = Jbr.mock.invoice[:issued_at]