Method: Dir#to_path

Defined in:
dir.c

#pathString? #to_pathString?

Returns the path parameter passed to dir’s constructor.

d = Dir.new("..")
d.path   #=> ".."

Overloads:

[View source]

689
690
691
692
693
694
695
696
697
# File 'dir.c', line 689

static VALUE
dir_path(VALUE dir)
{
    struct dir_data *dirp;

    TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
    if (NIL_P(dirp->path)) return Qnil;
    return rb_str_dup(dirp->path);
}