diff options
| -rw-r--r-- | file.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -5196,6 +5196,22 @@ rb_file_s_extname(VALUE klass, VALUE fname) * File.path(File::NULL) #=> "/dev/null" * File.path(Pathname.new("/tmp")) #=> "/tmp" * + * If +path+ is not a String: + * + * 1. If it has the +to_path+ method, that method will be called to + * coerce to a String. + * + * 2. Otherwise, or if the coerced result is not a String too, the + * standard coersion using +to_str+ method will take place on that + * object. (See also String.try_convert) + * + * The coerced string must satisfy the following conditions: + * + * 1. It must be in an ASCII-compatible encoding; otherwise, an + * Encoding::CompatibilityError is raised. + * + * 2. It must not contain the NUL character (<tt>\0</tt>); otherwise, + * an ArgumentError is raised. */ static VALUE |
