Class: Kiba::Extend::Registry::RegisteredSource

Inherits:
RegisteredFile show all
Includes:
Ancestorable, RequirableFile
Defined in:
lib/kiba/extend/registry/registered_source.rb

Overview

Value object representing a RegistryEntry being used as a job source

Since:

  • 2.2.0

Instance Attribute Summary

Attributes inherited from RegisteredFile

#data, #desc, #dest_class, #dest_opt, #dest_special_opts, #dynamic_source, #key, #lookup_on, #path, #src_opt, #supplied

Instance Method Summary collapse

Methods included from RequirableFile

#required

Methods included from Ancestorable

#edge, #edge_label, #edge_source_id, #edge_target_id, #node, #node_id, #source?

Methods included from NodeLabelable

#node_label, #node_qualification

Methods inherited from RegisteredFile

#src_class

Constructor Details

#initialize(key:, for_job:, data: nil) ⇒ RegisteredSource

Returns a new instance of RegisteredSource.

Since:

  • 2.2.0



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

def initialize(key:, for_job:, data: nil)
  super
  if dynamic_source
    fail Kiba::Extend::DynamicSourceUseError.new(
      key, self.class.name, for_job
    )
  end
end

Instance Method Details

#argsHash

Arguments for calling Kiba Source class

Returns:

  • (Hash)

Since:

  • 2.2.0



33
34
35
# File 'lib/kiba/extend/registry/registered_source.rb', line 33

def args
  {src_class.path_key => path}.merge(src_opts)
end

#klassObject

Since:

  • 2.2.0



37
38
39
# File 'lib/kiba/extend/registry/registered_source.rb', line 37

def klass
  src_class
end