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



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

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



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

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



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

def description
  desc
end

#klassObject

Since:

  • 2.2.0



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

def klass
  dest_class
end