Class: Remi::Loader::SubJob

Inherits:
Remi::Loader show all
Defined in:
lib/remi/data_subjects/sub_job.rb

Instance Attribute Summary collapse

Attributes inherited from Remi::Loader

#context, #logger

Instance Method Summary collapse

Methods inherited from Remi::Loader

#fields

Constructor Details

#initialize(*args, **kargs, &block) ⇒ SubJob

Returns a new instance of SubJob.

Parameters:

  • sub_job (Object)

    The name (relative to parent job) of the subjob to use

  • data_subject (Symbol)

    The name (relatvie to the sub job) of the sub job's data frame

  • merge_fields (True, False)

    Indicates whether fields from the calling data subject should be merged with those defined in the sub job.



32
33
34
35
# File 'lib/remi/data_subjects/sub_job.rb', line 32

def initialize(*args, **kargs, &block)
  super
  init_sub_job_loader(*args, **kargs, &block)
end

Instance Attribute Details

#data_subjectObject

Returns the value of attribute data_subject.



37
38
39
# File 'lib/remi/data_subjects/sub_job.rb', line 37

def data_subject
  @data_subject
end

#merge_fieldsObject

Returns the value of attribute merge_fields.



37
38
39
# File 'lib/remi/data_subjects/sub_job.rb', line 37

def merge_fields
  @merge_fields
end

#sub_jobObject

Returns the value of attribute sub_job.



37
38
39
# File 'lib/remi/data_subjects/sub_job.rb', line 37

def sub_job
  @sub_job
end

Instance Method Details

#autoloadObject



47
48
49
# File 'lib/remi/data_subjects/sub_job.rb', line 47

def autoload
  true
end

#load(data_frame) ⇒ true

Returns On success.

Parameters:

  • data_frame (Object)

    Data frame to load to target sub job data subject

Returns:

  • (true)

    On success



41
42
43
44
45
# File 'lib/remi/data_subjects/sub_job.rb', line 41

def load(data_frame)
  sub_job.sub_job.send(data_subject).df = data_frame
  sub_job.sub_job.send(data_subject).fields.merge! fields if merge_fields
  true
end