Class: Jbr::Mock::Job

Inherits:
Job show all
Defined in:
lib/jbr/mock/job.rb

Overview

A job that reads from Jbr.mock instead of Jobber.

Constant Summary

Constants inherited from Job

Job::FIND

Instance Attribute Summary

Attributes inherited from Job

#quote_id

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



15
# File 'lib/jbr/mock/job.rb', line 15

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

#find(_) ⇒ Mock::Job

Returns itself, carrying the mocked IDs.

Returns:

  • (Mock::Job)

    itself, carrying the mocked IDs.



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

def find(_)
  @id = Jbr.mock.job[:id]
  @quote_id = Jbr.mock.job[:quote_id]

  self
end

#scheduled_atTime?

Returns the times the app asked for.

Returns:

  • (Time, nil)

    the times the app asked for.



13
# File 'lib/jbr/mock/job.rb', line 13

def scheduled_at = Jbr.mock.job[:scheduled_at]