Module: Fiona7::NameAndParentFromPath

Included in:
Builder::ContainerChainBuilder, Builder::ObjBuilder
Defined in:
lib/fiona7/name_and_parent_from_path.rb

Instance Method Summary collapse

Instance Method Details

#name_and_parent_path_from_path(path) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/fiona7/name_and_parent_from_path.rb', line 3

def name_and_parent_path_from_path(path)
  components = path.split('/')
  name       = components.pop.presence
  parent_path= components.join('/').presence || '/'

  return name, parent_path
end