Class: Kiba::Extend::Jobs::NullJob

Inherits:
BaseJob
  • Object
show all
Defined in:
lib/kiba/extend/jobs/null_job.rb

Overview

Placeholder job that reports that given name (or generic null job) was run, but does not actually try to run a real job.

This is useful in projects with dynamically-defined or registered jobs when some dependency jobs (sources, lookups) may not return any output yet (or ever).

Since:

  • 7.0.0

Instance Attribute Summary

Attributes inherited from BaseJob

#files, #srcrows, #transformer

Instance Method Summary collapse

Methods inherited from BaseJob

#context, #control

Methods included from Parser

#parse_job

Methods included from Runnable

#add_config, #add_decoration, #add_destinations, #add_lookup, #add_sources, #assemble_control, #lookups_to_memoized_methods, #parse_job_segments, #show_me_decoration, #sources, #tell_me_decoration, #transform

Methods included from Reportable

#desc_and_tags, #get_duration, #minimal_end, #minimal_start, #normal_end, #normal_start, #put_file_details, #report_run_end, #report_run_start, #row_report, #start_and_def, #start_label, #tags, #verbose_end, #verbose_start

Methods included from DependencyHandleable

#check_requirements, #destinations, #file_config, #handle_requirements, #prep_file, #setup_file_for, #setup_files, #setup_files_for, #setup_source_for, #sources

Constructor Details

#initialize(name = nil, files:) ⇒ NullJob

Returns a new instance of NullJob.

Parameters:

  • name (NilValue) (defaults to: nil)
    • DEPRECATED - do not use
  • files (Hash)

    as passed to a normal Job.

Since:

  • 7.0.0



16
17
18
# File 'lib/kiba/extend/jobs/null_job.rb', line 16

def initialize(name = nil, files:)
  super(files: files, transformer: nil)
end

Instance Method Details

#outrowsObject

Since:

  • 7.0.0



24
# File 'lib/kiba/extend/jobs/null_job.rb', line 24

def outrows = 0

#runObject

Since:

  • 7.0.0



20
21
22
# File 'lib/kiba/extend/jobs/null_job.rb', line 20

def run
  puts "#{destination_key} was run as Kiba::Extend::Jobs::NullJob"
end