Method: QB::Path#relative

Defined in:
lib/qb/path.rb

#relativeQB::Path?

Relative path from #cwd to self, if one exists.

Returns:

  • (QB::Path)

    If a relative path from #cwd to self exists.

  • (nil)

    If no relative path from #cwd to self exists. Can't recall exactly how this happens, but I guess it can...



217
218
219
220
221
222
223
# File 'lib/qb/path.rb', line 217

def relative
  begin
    relative_path_from cwd
  rescue ArgumentError => error
    nil
  end
end