Class: Kiba::Extend::Registry::RegisteredFile
- Inherits:
-
Object
- Object
- Kiba::Extend::Registry::RegisteredFile
show all
- Defined in:
- lib/kiba/extend/registry/registered_file.rb
Overview
Abstract base class defining interface for destination files,
lookup files, and source files returned by
FileRegistry
Defined Under Namespace
Classes: NoFilePathError
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(key:, data:, for_job:) ⇒ RegisteredFile
Returns a new instance of RegisteredFile.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 32
def initialize(key:, data:, for_job:)
raise FileNotRegisteredError, key unless data
raise NoFilePathError, key if data.errors.keys.any?(:missing_path)
@key = key
@data = data
@for_job = for_job
@path = data.path.to_s
@dest_class = data.dest_class
@dest_opt = data.dest_opt
@dest_special_opts = data.dest_special_opts
@src_opt = data.src_opt
@supplied = data.supplied
@lookup_on = data.lookup_on
@desc = data.desc
end
|
Instance Attribute Details
#data ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def data
@data
end
|
#desc ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def desc
@desc
end
|
#dest_class ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def dest_class
@dest_class
end
|
#dest_opt ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def dest_opt
@dest_opt
end
|
#dest_special_opts ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def dest_special_opts
@dest_special_opts
end
|
#key ⇒ Symbol
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def key
@key
end
|
#lookup_on ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def lookup_on
@lookup_on
end
|
#path ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def path
@path
end
|
#src_opt ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def src_opt
@src_opt
end
|
#supplied ⇒ Object
23
24
25
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 23
def supplied
@supplied
end
|
Instance Method Details
#src_class ⇒ Object
49
50
51
|
# File 'lib/kiba/extend/registry/registered_file.rb', line 49
def src_class
supplied ? data.src_class : dest_src
end
|