Class: EacTemplates::Modules::Ancestor
- Inherits:
-
Object
- Object
- EacTemplates::Modules::Ancestor
show all
- Defined in:
- lib/eac_templates/modules/ancestor.rb,
lib/eac_templates/modules/ancestor/file.rb,
lib/eac_templates/modules/ancestor/directory.rb,
lib/eac_templates/modules/ancestor/fs_object.rb
Defined Under Namespace
Modules: FsObject
Classes: Directory, File
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.path_for_search(a_module) ⇒ Pathname
13
14
15
|
# File 'lib/eac_templates/modules/ancestor.rb', line 13
def path_for_search(a_module)
a_module.name.underscore.to_pathname
end
|
Instance Method Details
#directory ⇒ EacTemplates::Modules::Directory
23
24
25
26
|
# File 'lib/eac_templates/modules/ancestor.rb', line 23
def directory
@directory ||= ::EacTemplates::Modules::Ancestor::Directory
.new(self, nil, nil, source_set: source_set)
end
|
#file ⇒ EacTemplates::Modules::File
29
30
31
32
|
# File 'lib/eac_templates/modules/ancestor.rb', line 29
def file
@file ||= ::EacTemplates::Modules::Ancestor::File
.new(self, nil, nil, source_set: source_set)
end
|
#path_for_search ⇒ Pathname
35
36
37
38
|
# File 'lib/eac_templates/modules/ancestor.rb', line 35
def path_for_search
r = self.class.path_for_search(ancestor)
subpath.if_present(r) { |v| r.join(v) }
end
|
41
42
43
44
45
46
|
# File 'lib/eac_templates/modules/ancestor.rb', line 41
def source_object
return file if file.found?
return directory if directory.found?
raise ::EacTemplates::Abstract::NotFoundError, "No template found: #{path_for_search}"
end
|