txt: ## parts.md
  class IO::Path::Parts
  
  IO::Path parts encapsulation
  
  ```raku
  class IO::Path::Parts does Positional does Associative does Iterable { }
  
  ```
  
  An `IO::Path::Parts` object is a container for the parts of an [`IO::Path`](/type/IO/Path) object. It is usually created with a call to the method [`.parts`](/type/IO/Path#method_parts) on an [`IO::Path`](/type/IO/Path) object. It can also be created with a call to the method [`.split`](/routine/split) on an object of one of the low-level path operations sub-classes of [`IO::Spec`](/type/IO/Spec).
  
  The parts of an [`IO::Path`](/type/IO/Path) are:
  
  * the volume, see [`.volume`](/type/IO/Path#method_volume)
  * the directory name, see [`.dirname`](/type/IO/Path#method_dirname)
  * the basename, see [`.basename`](/type/IO/Path#method_basename)
  
  # [Methods](#class_IO::Path::Parts "go to top of document")[§](#Methods "direct link")
  
  ## [method new](#class_IO::Path::Parts "go to top of document")[§](#method_new "direct link")
  
  ```raku
  method new(\volume, \dirname, \basename)
  ```
  
  Create a new `IO::Path::Parts` object with `\volume`, `\dirname` and `\basename` as respectively the volume, directory name and basename parts.
  
  ## [attribute volume](#class_IO::Path::Parts "go to top of document")[§](#attribute_volume "direct link")
  
  Read-only. Returns the volume of the `IO::Path::Parts` object.
  
  ```raku
  IO::Path::Parts.new('C:', '/some/dir', 'foo.txt').volume.say;
  # OUTPUT: «C:␤»
  
  ```
  
  ## [attribute dirname](#class_IO::Path::Parts "go to top of document")[§](#attribute_dirname "direct link")
  
  Read-only. Returns the directory name part of the `IO::Path::Parts` object.
  
  ```raku
  IO::Path::Parts.new('C:', '/some/dir', 'foo.txt').dirname.say;
  # OUTPUT: «/some/dir␤»
  
  ```
  
  ## [attribute basename](#class_IO::Path::Parts "go to top of document")[§](#attribute_basename "direct link")
  
  Read-only. Returns the basename part of the `IO::Path::Parts` object.
  
  ```raku
  IO::Path::Parts.new('C:', '/some/dir', 'foo.txt').basename.say;
  # OUTPUT: «foo.txt␤»
  
  ```
  
  # [Previous implementations](#class_IO::Path::Parts "go to top of document")[§](#Previous_implementations "direct link")
  
  Before Rakudo 2020.06 the `.parts` method of [`IO::Path`](/type/IO/Path) returned a [`Map`](/type/Map) and the `.split` routine of the [`IO::Spec`](/type/IO/Spec) sub-classes returned a [`List`](/type/List) of [`Pair`](/type/Pair). The `IO::Path::Parts` class maintains compatibility with these previous implementations by doing [`Positional`](/type/Positional), [`Associative`](/type/Associative) and [`Iterable`](/type/Iterable).
  
  ```raku
  my $parts = IO::Path::Parts.new('C:', '/some/dir', 'foo.txt');
  say $parts<volume>;      # OUTPUT: «C:␤»
  say $parts[0];           # OUTPUT: «volume => C:␤»
  say $parts[0].^name;     # OUTPUT: «Pair␤»
  .say for $parts[];
  # OUTPUT: «volume => C:␤dirname => /some/dir␤basename => foo.txt␤»
  
  ```
  