Method: Pathname#^

Defined in:
lib/pleasant_path/pathname.rb

#^(sibling) ⇒ Pathname

Joins the Pathname’s dirname with the given sibling.

The mnemonic for this operator is that the result is formed by going up one directory level from the original path, then going back down to sibling.

Examples:

Pathname.new("path/to/file1") ^ "file2"  # == Pathname.new("path/to/file2")

Parameters:

Returns:



29
30
31
# File 'lib/pleasant_path/pathname.rb', line 29

def ^(sibling)
  self.dirname / sibling
end