Method: Pathname#parentname

Defined in:
lib/pleasant_path/pathname.rb

#parentnamePathname

Returns the basename of the Pathname’s dirname.

Examples:

Pathname.new("grand/parent/base").parentname  # == Pathname.new("parent")

Returns:



39
40
41
# File 'lib/pleasant_path/pathname.rb', line 39

def parentname
  self.dirname.basename
end