Module: Kiba::Extend::Registry::RequirableFile

Included in:
RegisteredLookup, RegisteredSource
Defined in:
lib/kiba/extend/registry/requirable_file.rb

Overview

Mixin module for children of RegisteredFile that other jobs depend upon

Since:

  • 2.2.0

Defined Under Namespace

Classes: NoDependencyCreatorError

Instance Method Summary collapse

Instance Method Details

#requiredMethod

Returns the creator method for a required dependency job.

Returns:

  • (Method)

    the creator method for a required dependency job

Since:

  • 2.2.0



21
22
23
24
25
26
27
28
29
30
# File 'lib/kiba/extend/registry/requirable_file.rb', line 21

def required
  return if File.exist?(@data.path)

  %i[missing_creator_for_non_supplied_file
    creator_not_a_method].each do |err|
    raise NoDependencyCreatorError, @key if @data.errors.keys.any?(err)
  end

  @data.creator
end