Module: NeverBounce::API::Response::Feature::JobStatusFields

Defined in:
lib/never_bounce/api/response/feature/job_status_fields.rb,
lib/never_bounce/api/response/feature/job_status_fields/total.rb

Overview

Common traits for message/container of the job status.

See Also:

Defined Under Namespace

Modules: InstanceMethods Classes: Total

Class Method Summary collapse

Class Method Details

.load(owner) ⇒ nil

Parameters:

  • owner (Class)

Returns:

  • (nil)

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/never_bounce/api/response/feature/job_status_fields.rb', line 12

def self.load(owner)
  # Validate owner, or calls to `oattr` will fail.
  raise ArgumentError, "Class #{owner} is not an ancestor of Response::Container" if not owner < Response::Container

  return if owner < InstanceMethods
  owner.send(:include, InstanceMethods)

  owner.class_eval do
    oattr :id, :scalar, type: :integer

    oattr :job_status, :scalar

    oattr :bounce_estimate, :scalar, type: :float
    oattr :filename, :scalar
    oattr :percent_complete, :scalar, type: :float

    oattr :total, :writer

    oattr :created_at, :scalar
    oattr :finished_at, :scalar
    oattr :started_at, :scalar
  end
end