Class: EacTemplates::Modules::Ancestor

Inherits:
Object
  • Object
show all
Includes:
Abstract::WithDirectoryFileMethods
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

Constant Summary collapse

NO_NAME_NAME =
'__undefined__'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Abstract::WithDirectoryFileMethods

#build_fs_object, #child_subpath, #directory?, #file?, #file_template?, #found?, #fs_object_class, #sub_fs_object, #to_s

Class Method Details

.path_for_search(a_module) ⇒ Pathname

Parameters:

Returns:

  • (Pathname)


17
18
19
# File 'lib/eac_templates/modules/ancestor.rb', line 17

def path_for_search(a_module)
  a_module.name.if_present(NO_NAME_NAME, &:underscore).to_pathname
end

Instance Method Details

#ancestor_path_for_searchObject



26
27
28
# File 'lib/eac_templates/modules/ancestor.rb', line 26

def ancestor_path_for_search
  self.class.path_for_search(ancestor)
end

#path_for_searchPathname

Returns:

  • (Pathname)


31
32
33
34
# File 'lib/eac_templates/modules/ancestor.rb', line 31

def path_for_search
  r = ancestor_path_for_search
  subpath.if_present(r) { |v| r.join(v) }
end