Class: Kiba::Extend::Registry::RegisteredDestination

Inherits:
RegisteredFile show all
Defined in:
lib/kiba/extend/registry/registered_destination.rb

Overview

Value object representing a destination file registered in a FileRegistry

Since:

  • 2.2.0

Defined Under Namespace

Classes: SuppliedEntryError

Instance Attribute Summary

Attributes inherited from RegisteredFile

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

Instance Method Summary collapse

Methods inherited from RegisteredFile

#src_class

Constructor Details

#initialize(key:, data:, for_job:) ⇒ RegisteredDestination

Returns a new instance of RegisteredDestination.

Since:

  • 2.2.0



20
21
22
23
# File 'lib/kiba/extend/registry/registered_destination.rb', line 20

def initialize(key:, data:, for_job:)
  super
  fail SuppliedEntryError.new(key) if supplied
end

Instance Method Details

#argsObject

Arguments for calling Kiba Destination class

Since:

  • 2.2.0



26
27
28
29
30
31
32
33
34
# File 'lib/kiba/extend/registry/registered_destination.rb', line 26

def args
  return simple_args unless dest_special_opts

  opts = supported_special_opts
  warn_about_opts if opts.length < dest_special_opts.length
  return simple_args if opts.empty?

  simple_args.merge(supported_special_opts)
end

#descriptionObject

Description of file

Used in post-processing STDOUT

Since:

  • 2.2.0



39
40
41
# File 'lib/kiba/extend/registry/registered_destination.rb', line 39

def description
  desc
end

#klassObject

Since:

  • 2.2.0



43
44
45
# File 'lib/kiba/extend/registry/registered_destination.rb', line 43

def klass
  dest_class
end